﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PurInvoiceWithItemLevel.aspx.cs"
    Inherits="Main_Inventory_PurInvoiceWithItemLevel" EnableEventValidation="false"
    Culture="en-GB" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControl" %>
<%--<%@ Register Assembly="CalendarExtenderPlus" Namespace="AjaxControlToolkitPlus" TagPrefix="advancedCalender" %>--%>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Purchased Received</title>
    <link rel="Stylesheet" href="../../Styles/accounts.css" type="text/css" />    
    <script src="../../JavaScript/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        function AlterTinNo() {
            Alert("Please Enter the Tin No Of this Supplier.");
            return false;
        }
        function isNumberKey(control_id, evt) {
            var charCode = (evt.which) ? evt.which : event.keyCode
            if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode < 45 || charCode > 47))
                return false;

            if (charCode == 46) {
                var dotcount = document.getElementById(control_id).value.split('.').length - 1;
                if (dotcount >= 1) {
                    return false;
                }
            }
            return true;
        }
        function SubTotalcalculation() {
            var count = document.getElementById("hidControlTblItems").value;
            var tempsubamt = 0; var tempsaleamt = 0; var tempfreight = 0; var temppackage = 0; var tempinsurance = 0; var temptotal = 0;
            for (var i = 1; i <= count; i++) {
                if (document.getElementById("txtsubamount" + i).value == '') {
                }
                else {
                    tempsubamt = document.getElementById("txtsubamount" + i).value;
                    tempsaleamt = document.getElementById("txtvatcstamt" + i).value;
                    tempfreight = document.getElementById("txtfreight" + i).value;
                    temppackage = document.getElementById("txtpackaging" + i).value;
                    tempinsurance = document.getElementById("txtinsurance" + i).value;
                    temptotal = parseFloat(parseFloat(tempsubamt) + parseFloat(tempsaleamt) + parseFloat(tempfreight) + parseFloat(temppackage) + parseFloat(tempinsurance)).toFixed(2);
                    document.getElementById("txttotallanded" + i).value = parseFloat(temptotal).toFixed(2);
                    document.getElementById("txttotalinventcost" + i).value = parseFloat(parseFloat(temptotal) - parseFloat(tempsaleamt)).toFixed(2);
                    //alert(temptotal + '=' + tempsubamt + '/' + tempsaleamt + '/' + tempfreight + '/' + temppackage + '/' + tempinsurance);
                }
            }
        }
        function CalculateRoundOff() {
            var temproundoff = document.getElementById("txtRoundoff").value;
            var subamount = 0; var amount = 0; var salestaxtotal = 0; var tempsubvalue = 0;
            if (temproundoff > 0) {

            }
            else if (temproundoff <= 0 || temproundoff == '') {

            }
            GrandTotal();
        }
        function CalculateInsurance() {
            var tempfreight = document.getElementById("txtinsurance").value;
            var count = document.getElementById("hidControlTblItems").value;
            var subamount = 0; var amount = 0; var salestaxtotal = 0; var tempsubvalue = 0;
            if (tempfreight > 0) {
                for (var j = 1; j <= count; j++) {
                    if (document.getElementById("txtsubamount" + j).value != '') {
                        amount = parseFloat(amount) + parseFloat(document.getElementById("txtsubamount" + j).value);
                    }
                }
                for (var i = 1; i <= count; i++) {
                    tempsubvalue = document.getElementById("txtsubamount" + i).value
                    if (document.getElementById("txtsubamount" + i).value == '') {
                        amount = 0; subamount = parseFloat(tempfreight) / parseFloat(amount);
                        salestaxtotal = subamount * 0;
                        document.getElementById("txtinsurance" + i).value = '';
                    }
                    else {
                        subamount = parseFloat(tempfreight) / parseFloat(amount);
                        salestaxtotal = parseFloat(subamount) * parseFloat(tempsubvalue);
                        //alert(tempfreight + '/' + amount + '*' + tempsubvalue + '/' + salestaxtotal);
                    }
                    if (salestaxtotal != '' && parseFloat(salestaxtotal) > 0) {
                        document.getElementById("txtinsurance" + i).value = parseFloat(salestaxtotal).toFixed(2);
                    }
                }
            }
            else if (tempfreight <= 0 || tempfreight == '') {
                for (var j = 1; j <= count; j++) {
                    if (document.getElementById("txtsubamount" + j).value == '') {
                    }
                    else {
                        document.getElementById("txtinsurance" + j).value = '0.00';
                    }
                }
            }
            LandedCost();
            TotalLandedCost();
            GrandTotal();
        }
        function CalculatePackaging() {
            var tempfreight = document.getElementById("txtpackaging").value;
            var count = document.getElementById("hidControlTblItems").value;
            var subamount = 0; var amount = 0; var salestaxtotal = 0; var tempsubvalue = 0;
            if (tempfreight > 0) {
                for (var j = 1; j <= count; j++) {
                    if (document.getElementById("txtsubamount" + j).value != '') {
                        amount = parseFloat(amount) + parseFloat(document.getElementById("txtsubamount" + j).value);
                    }
                }
                for (var i = 1; i <= count; i++) {
                    tempsubvalue = document.getElementById("txtsubamount" + i).value
                    if (document.getElementById("txtsubamount" + i).value == '') {
                        amount = 0;
                        subamount = parseFloat(tempfreight) / parseFloat(amount);
                        salestaxtotal = subamount * 0;
                        document.getElementById("txtpackaging" + i).value = '';
                    }
                    else {
                        subamount = parseFloat(tempfreight) / parseFloat(amount);
                        salestaxtotal = parseFloat(subamount) * parseFloat(tempsubvalue);
                        //alert(tempfreight + '/' + amount + '*' + tempsubvalue + '/' + salestaxtotal);
                    }
                    if (salestaxtotal != '' && parseFloat(salestaxtotal) > 0) {
                        document.getElementById("txtpackaging" + i).value = parseFloat(salestaxtotal).toFixed(2);
                    }
                }
            }
            else if (tempfreight <= 0 || tempfreight == '') {
                for (var j = 1; j <= count; j++) {
                    if (document.getElementById("txtsubamount" + j).value == '') {
                    }
                    else {
                        document.getElementById("txtpackaging" + j).value = '0.00';
                    }
                }
            }
            LandedCost();
            TotalLandedCost();
            GrandTotal();
        }
        function calculatefreight() {
            var tempfreight = document.getElementById("txtfreight").value;
            var count = document.getElementById("hidControlTblItems").value;
            var subamount = 0; var amount = 0; var salestaxtotal = 0; var tempsubvalue = 0;
            if (tempfreight > 0) {
                for (var j = 1; j <= count; j++) {
                    if (document.getElementById("txtsubamount" + j).value != '') {
                        amount = parseFloat(amount) + parseFloat(document.getElementById("txtsubamount" + j).value);
                    }
                }
                for (var i = 1; i <= count; i++) {
                    tempsubvalue = document.getElementById("txtsubamount" + i).value
                    if (document.getElementById("txtsubamount" + i).value == '') {
                        amount = 0; subamount = parseFloat(tempfreight) / parseFloat(amount);
                        salestaxtotal = subamount * 0;
                        document.getElementById("txtfreight" + i).value = '';
                    }
                    else {
                        subamount = parseFloat(tempfreight) / parseFloat(amount);
                        salestaxtotal = parseFloat(subamount) * parseFloat(tempsubvalue);
                        //alert(tempfreight + '/' + amount + '*' + tempsubvalue + '/' + salestaxtotal);
                    }
                    if (salestaxtotal != '' && parseFloat(salestaxtotal) > 0) {
                        document.getElementById("txtfreight" + i).value = parseFloat(salestaxtotal).toFixed(2);
                    }
                }
            }
            else if (tempfreight <= 0 || tempfreight == '') {
                for (var j = 1; j <= count; j++) {
                    if (document.getElementById("txtsubamount" + j).value == '') {
                    }
                    else {
                        document.getElementById("txtfreight" + j).value = '0.00';
                    }
                }
            }
            LandedCost();
            TotalLandedCost();
            GrandTotal();

        }
        function CheckRate() {
            var count = document.getElementById("hidControlTblItems").value;
            for (var i = 1; i <= count; i++) {
                var hiddenrate = document.getElementById("hidunitprice" + i).value;
                var textboxrate = document.getElementById("txtunitprice" + i).value;
                if (parseFloat(textboxrate) > parseFloat(hiddenrate)) {
                    alert("Your Unit Price for this Item is:-" + parseFloat(hiddenrate).toFixed(2));
                    document.getElementById("txtunitprice" + i).value = "";
                    document.getElementById("txtunitprice" + i).focus();
                    return false;
                }
            }
        }
        function Calculate(row) {
            DefaultValue();
            SubAmount(row)
                VATCST();
                LandedCost();
                InventoryCost();
                TotalItemQty();
                TotalLandedCost();
                TotalInventory();
                GrandTotal();
            }
        function VATCST() {
            var Count = document.getElementById("hidControlTblItems").value;
            var TotalVatCst = 0;
            for (var i = 1; i <= Count; i++) {
                TotalVatCst = parseFloat(TotalVatCst) + parseFloat(document.getElementById("txtvatcstamt" + i).value);
            }
            document.getElementById("txtVat").value = parseFloat(TotalVatCst).toFixed(2);
        }
        function GrandTotal() {
            var posttax = document.getElementById("txtGrossAmount").value; //Total Landed Cost
            var freight = document.getElementById("txtfreight").value;
            var package = document.getElementById("txtpackaging").value;
            var insurance = document.getElementById("txtinsurance").value;
            var roundoff = document.getElementById("txtRoundoff").value;
            if (posttax == '')
            { posttax = '0.0'; }
            if (freight == '')
            { freight = '0.0'; }
            if (package == '')
            { package = '0.0'; }
            if (insurance == '')
            { insurance = '0.0'; }
            if (roundoff == '')
            { roundoff = '0.0'; }
            var total = parseFloat(parseFloat(posttax) + parseFloat(roundoff)).toFixed(2);
            document.getElementById("txtGrandTotal").value = parseFloat(total).toFixed(2);
            //SubTotalcalculation();
        }
        function TotalInventory() {
            var Count = document.getElementById("hidControlTblItems").value;
            var TotalInventoryCost = 0;
            for (var i = 1; i <= Count; i++) {
                TotalInventoryCost = parseFloat(TotalInventoryCost) + parseFloat(document.getElementById("txttotalinventcost" + i).value);
            }
            document.getElementById("txtTaxableAmt").value = parseFloat(TotalInventoryCost).toFixed(2);
        }
        function TotalLandedCost() {
            var Count = document.getElementById("hidControlTblItems").value;
            var TotalLandedCost = 0;
            for (var i = 1; i <= Count; i++) {
                TotalLandedCost = parseFloat(TotalLandedCost) + parseFloat(document.getElementById("txttotallanded" + i).value);
            }
            document.getElementById("txtGrossAmount").value = parseFloat(TotalLandedCost).toFixed(2);
        }
        function TotalItemQty() {
            var Count = document.getElementById("hidControlTblItems").value;
            var TotalQty = 0;
            for (var i = 1; i <= Count; i++) {
                TotalQty = parseFloat(TotalQty) + parseFloat(document.getElementById("txtqty" + i).value);
            }
            document.getElementById("txtTotalQuantity").value = parseFloat(TotalQty).toFixed(0);
        }
        function LandedCost() {
            var Count = document.getElementById("hidControlTblItems").value;
            for (var i = 1; i <= Count; i++) {
                document.getElementById("txttotallanded" + i).value = parseFloat(parseFloat(document.getElementById("txtsubamount" + i).value) +
            parseFloat(document.getElementById("txtvatcstamt" + i).value) +
            parseFloat(document.getElementById("txtServiceTaxAmount" + i).value) +
            parseFloat(document.getElementById("txtfreight" + i).value) +
            parseFloat(document.getElementById("txtinsurance" + i).value) +
            parseFloat(document.getElementById("txtpackaging" + i).value)).toFixed(2);
            }
        }
        function InventoryCost() {
            var Count = document.getElementById("hidControlTblItems").value;
            for (var i = 1; i <= Count; i++) {
                document.getElementById("txttotalinventcost" + i).value = parseFloat(parseFloat(document.getElementById("txttotallanded" + i).value) -
            parseFloat(document.getElementById("txtvatcstamt" + i).value) -
            parseFloat(document.getElementById("txtServiceTaxAmount" + i).value)).toFixed(2);
            }
        }
        function SubAmount(row) {
            var Count = document.getElementById("hidControlTblItems").value;
            if (document.getElementById("txtqty" + row).value > document.getElementById("hidDoqty" + row).value) {
                alert("You Can Not Receive More than Purchase Order Qty.");
                document.getElementById("txtqty" + row).value = document.getElementById("hidDoqty" + row).value;               
            }                      
            for (var i = 1; i <= Count; i++) {
                document.getElementById("txtsubamount" + i).value = parseFloat(parseFloat(document.getElementById("txtunitprice" + i).value) * parseFloat(document.getElementById("txtqty" + i).value)).toFixed(2);
            }
            
        }
        function DefaultValue() {
            var Count = document.getElementById("hidControlTblItems").value;
            for (var i = 1; i <= Count; i++) {
                document.getElementById("txtvatcstamt" + i).value = '0.00';
                document.getElementById("txtServiceTax" + i).value = '0.00';
                document.getElementById("txtServiceTaxAmount" + i).value = '0.00';
                document.getElementById("txtfreight" + i).value = '0.00';
                document.getElementById("txtinsurance" + i).value = '0.00';
                document.getElementById("txtpackaging" + i).value = '0.00';
                document.getElementById("txttotallanded" + i).value = '0.00';
                document.getElementById("txttotalinventcost" + i).value = '0.00';
            }
        }
        function SalestaxAmount() {
            var count = document.getElementById("hidControlTblItems").value;
            for (var i = 1; i <= count; i++) {
                document.getElementById("txtServiceTax" + i).value = '0.00';
            }
        }
        function GetQuantity(hidItemId, CtrlId, OrderQty, HidLocationId) {
            var ctrlIndex = HidLocationId.toString();
            var LocationIdandQty = document.getElementById(ctrlIndex).value;
            window.open('WinPurchaseQty.aspx?ItemId=' + hidItemId + '&CtrlId=' + CtrlId + '&OrderQty=' + OrderQty + '&HidLocationId=' + HidLocationId + '&LocationIdandQty=' + LocationIdandQty, 'Quantity', 'width=700, height=400, resizable=0');
        }
        function Validation() {
            var flag = true;
            var count = document.getElementById("hidControlTblItems").value;
            for (var i = 1; i <= count; i++) {
                var receivedQty = document.getElementById("txtReceivedQty" + i).value;
                var taxRate = document.getElementById("hidTaxRate" + i).value;
                var txtAmtRate = document.getElementById("txtRate" + i).value;
                var grossAmt = document.getElementById("txtGrossAmt" + i).value;
                var amountPayable = document.getElementById("txtAmountPayable" + i).value;
                var ddlPurchase = document.getElementById("ddlPurchaseLedger" + i);
                var taxAmt = document.getElementById("txtTaxAmt" + i).value;
                var ddlTax = document.getElementById("ddlTaxLedger" + i);
                var dllPurchaseValue = ddlPurchase.options[ddlPurchase.selectedIndex].value;
                var ddlTaxValue = ddlTax.options[ddlTax.selectedIndex].value;

                if (parseFloat(receivedQty) > 0 && parseFloat(txtAmtRate) > 0) {
                    if (parseFloat(grossAmt) > 0 && dllPurchaseValue == '0') {
                        alert('Specify Purchase Ledger at row no. ' + i);
                        flag = false;
                    }
                    else if (parseFloat(taxAmt) > 0 && ddlTaxValue == '0') {
                        alert('Specify Tax Ledger at row no. ' + i);
                        flag = false;
                    }
                }
            }
            return flag;
        }
        function ValidationMain() {
            var flag = true;
            var txtVoucher = document.getElementById("txtVoucher").value;
            var txtInvoiceNo = document.getElementById("txtInvoiceNo").value;
            var txtDate = document.getElementById("txtDate").value;
            var ddlTaxGroup = document.getElementById("ddlTaxGroup");
            var txtPurchaseRecdate = document.getElementById("TxtPurchaseReceiveDate").value;
            var ddlTaxGroupValue = ddlTaxGroup.options[ddlTaxGroup.selectedIndex].value;
            if (txtVoucher == '') {
                alert('Specify Voucher no');
                document.getElementById("txtVoucher").focus();
                flag = false;
            }
            else if (txtInvoiceNo == '') {
                alert('Specify Invoice no');
                document.getElementById("txtInvoiceNo").focus();
                flag = false;
            }
            else if (txtDate == '' || txtDate == '__/__/____') {
                alert('Specify Date ');
                document.getElementById("txtDate").focus();
                flag = false;
            }
            else if (ddlTaxGroupValue == '0') {
                alert('Specify Tax Group');
                document.getElementById("ddlTaxGroup").focus();
                flag = false;
            }
            else if (txtPurchaseRecdate == '' || txtPurchaseRecdate == '__/__/____') {
                alert('Please Enter the Purchase Receive Date');
                document.getElementById("TxtPurchaseReceiveDate").focus();
                flag = false;
            }
            else if (document.getElementById("ddlcurrency").selectedIndex > 1) {
                if (document.getElementById("txtexcrate").value <= 0) {
                    alert("Please Enter the Correct Exchange Rate.");
                    document.getElementById("txtexcrate").focus();
                    flag = false;
                }
            }
            return flag;
        }
        function ValidateAtLeastOneRecord() {
            var flag = true;
            var intCount = 0;
            var count = 0;
            count = document.getElementById("hidControlTblItems").value;
            for (var i = 1; i <= count; i++) {
                var PartNo = document.getElementById("txtpartno" + i).value;
                var PartDesc = document.getElementById("txtdesc" + i).value;
                var Unitprice = document.getElementById("txtunitprice" + i).value;
                var Qty = document.getElementById("txtqty" + i).value;
                var SubAmount = document.getElementById("txtsubamount" + i).value;
                var salestaxamount = document.getElementById("ddlsalestax" + i).selectedIndex;
                var SalesTax = document.getElementById("txtvatcstamt" + i).value;
                var totallandedcost = document.getElementById("txttotallanded" + i).value;
                var totalInventarycost = document.getElementById("txttotalinventcost" + i).value;

                if (Unitprice == '' || Unitprice == 0) {
                    alert('Please Insert Unit Price of Row Number ' + i);
                    document.getElementById("txtunitprice" + i).focus();
                    flag = false;
                    break;
                }
                else if (Qty == '') {
                    alert('Please Insert Qty of Row Number ' + i);
                    document.getElementById("txtqty" + i).focus();
                    flag = false;
                    break;
                }
                else if (SubAmount == '') {
                    alert('Please Insert Sub Amount of Row Number ' + i);
                    document.getElementById("txtsubamount" + i).focus();
                    flag = false;
                    break;
                }
                else if (salestaxamount != 0 && SalesTax == 0) {
                    alert('Please Insert Sales Tax Amount of Row Number ' + i);
                    document.getElementById("ddlsalestax" + i).focus();
                    flag = false;
                    break;
                }
                else if (totallandedcost == '') {
                    alert('Please Insert Total Landed Cost of Row Number ' + i);
                    document.getElementById("txttotallanded" + i).focus();
                    flag = false;
                    break;
                }
                else {
                    flag = true;
                }
            }
            return flag;
        }
        function AllValidation() {
            //alert(document.getElementById("HidCurrency").value);
            if (document.getElementById("HidCurrency").value == 1) {
                if (ValidationMain() && ValidateAtLeastOneRecord() && Validation()) {
                    return true;
                }
                else {
                    return false;
                }
            }
            if (document.getElementById("HidCurrency").value >= 2) {
                if (ValidationMain() && importValidation()) {
                    alert("Stock Updated...... ");
                    return true;
                }
                else {
                    return false;
                }
            }
        }
        function importValidation() {
            var flagI = true;
            count = document.getElementById("hidimportTblItems").value;            
            for (var i = 1; i <= count; i++) {
                var IUnitPrice = document.getElementById("txtIUnitPrice" + i).value;
                var ICOO = document.getElementById("ddlIcoo" + i).selectedIndex;
                var IQty = document.getElementById("txtIQty" + i).value;
                var IInvoiceValue = document.getElementById("txtIInvoiceVal" + i).value;
                var IunitpriceINR = document.getElementById("txtIUnitPriceINR" + i).value;
                var ItotallandedCost = document.getElementById("txtILandedCost" + i).value;
                //alert(IUnitPrice + ' ---- ' + IQty + ' --- ' + IAssesValue + ' --- ' + IInvoiceValue);                
                if ((IUnitPrice == '' || IUnitPrice == 0) && document.getElementById("ddlleasedtype").selectedIndex != 2) {
                    alert('Please Insert Unit Price of Row Number ' + i);
                    document.getElementById("txtIUnitPrice" + i).focus();
                    flagI = false;
                    break;
                }
                else if (ICOO == 0) {
                    alert('Please Select COO of Row Number ' + i);
                    document.getElementById("ddlIcoo" + i).focus();
                    flagI = false;
                    break;
                }
                else if (IQty == '') {
                    alert('Please Insert Total Quantity of Row Number ' + i);
                    document.getElementById("txtIQty" + i).focus();
                    flagI = false;
                    break;
                }
                else if ((IInvoiceValue == '') && document.getElementById("ddlleasedtype").selectedIndex != 2) {
                    alert('Please Insert Invoice Value Cost of Row Number ' + i);
                    document.getElementById("txtIInvoiceVal" + i).focus();
                    flagI = false;
                    break;
                }
                else if ((IunitpriceINR == '' || IunitpriceINR == 0) && document.getElementById("ddlleasedtype").selectedIndex != 2) {
                    alert('Please Insert Unit Price (INR) of Row Number ' + i);
                    document.getElementById("txtIUnitPriceINR" + i).focus();
                    flagI = false;
                    break;
                }
                else if ((ItotallandedCost == '') && document.getElementById("ddlleasedtype").selectedIndex !=2 ) {
                    alert('Please Insert TotalLanded Cost of Row Number ' + i);
                    document.getElementById("txtILandedCost" + i).focus();
                    flagI = false;
                    break;
                }
                else {
                    flagI = true;
                }
            }
            //alert(flagI+"gggggggg");
            return flagI;
        }

        function SetZero(id) {
            var control = document.getElementById(id);
            if (control.value == '') {
                control.value = '0.00';
            }
            else {
                control.value = parseFloat(control.value).toFixed(2);
            }
        }
        function RemoveZero(id) {
            var control = document.getElementById(id);
            if (control.value == '0.00') {
                control.value = '';
            }
        }
        function roundOff(id) {
            var totalAmt = 0;
            var postTax = document.getElementById("txtPostTaxTotal").value;
            var roundOff = document.getElementById(id).value;
            if (parseFloat(postTax) > parseFloat(roundOff)) {
                totalAmt = parseFloat(postTax) + parseFloat(roundOff);
                document.getElementById("txtGrandTotal").value = parseFloat(totalAmt).toFixed(2);
                document.getElementById(id).value = parseFloat(roundOff).toFixed(2);
            }
            else {
                document.getElementById(id).value = '0.00';
                document.getElementById("txtGrandTotal").value = parseFloat(postTax).toFixed(2);
            }

        }
        function CatchTab(myfield, e) {//disable keydown event of textbox not TAB key
            var keycode;
            if (window.event) {
                keycode = window.event.keyCode;
            }
            else if (e) {
                keycode = e.which;
            }
            else {
                return true;
            }

            if (keycode == 9) {
                // if is the tab key
                return true;
            }
            else {
                return false;
            }
        }
        function DisableRightClick(event) {   //For mouse right click
            if (event.button == 2) {
                return false
            }
        }

        function ErrorMessage(msg) {
            alert(msg);
            return false;
        }

        function OpenWindow(poid) {
            window.open('InventoryPrint/Default.aspx?Poid=' + poid, '', 'width=800,height=600,toolbar=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
        }
        function checkTaxGroup(id) {
            var ddl = document.getElementById(id);
            if (ddl.length == 0) {
                alert('select Tax Group');
                document.getElementById("ddlTaxGroup").focus();
            }
        }
    </script>
    <style type="text/css">
        #wrapper
        {
            margin-left: 1%;
            margin-top: 15px;
        }
        ul.tabs
        {
            margin: 0;
            padding: 0;
        }
        ul.tabs li
        {
            display: block;
            float: left;
            padding: 0 5px;
        }
        ul.tabs li a
        {
            display: block;
            float: left;
            padding: 5px;
            font-size: 0.8em;
            background-color: #e0e0e0;
            color: #666;
            text-decoration: none;
            height: 12px;
        }
        .selected
        {
            font-weight: bold;
        }
        .tab-content
        {
            clear: both;
            border: 1px solid #ddd;
            padding: 10px;
        }
        .style1
        {
            height: 30px;
        }
        .modalBackground
        {
            background-color: #FFFFFF;
            filter: alpha(opacity=40);
            opacity: 0.4;
        }
        .popup
        {
            background-color: #AEAEAE;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.tabs a').click(function () {
                switch_tabs($(this));
            });
            switch_tabs($('.defaulttab'));            
        });
        function switch_tabs(obj) {
            $('.tab-content').hide();
            $('.tabs a').removeClass("selected");
            var id = obj.attr("rel");
            $('#' + id).show();
            obj.addClass("selected");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" EnablePageMethods="true"
            runat="server">
        </asp:ScriptManager>
        <div class="divmain">
            <acc:heading ID="pagehead" runat="server" HeadingText="Purchase Receive" />
        </div>
        <div style="margin-left: 5%; margin-right: 5%; width: 90%" align="center">
            <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label>
        </div>
        <asp:HiddenField ID="HidCurrency" Value="0" runat="server" />
        <asp:HiddenField ID="HidBillFormat" Value="0" runat="server" />
        <div style="margin-left: 2%; margin-right: 5%; margin-top: 10px">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <table class="tablecontent" width="95%" style="margin-left: 2%;">
                        <tr>
                            <td class="headtd" colspan="4">
                                Purchase Invoice Details
                                <asp:HiddenField ID="hidBillformatId" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                P.O. Number
                            </td>
                            <td>
                                <asp:HyperLink ID="hyperPoNumber" runat="server" Style="background-color: #C8D0D4;"
                                    Height="18px" CssClass="input" Width="145px" NavigateUrl="#"></asp:HyperLink>
                                <asp:HiddenField ID="templocationid" runat="server" />
                            </td>
                            <td>
                                Supplier
                            </td>
                            <td>
                                <asp:Label ID="lblSupplier" runat="server" Height="18px" Style="background-color: #C8D0D4;"
                                    CssClass="input" Width="280px"></asp:Label>
                                <asp:HiddenField ID="hidSupplierID" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Voucher No.<span style="color: Red">*</span>
                            </td>
                            <td>
                                <asp:TextBox ID="txtPrefix" Style="background-color: #C8D0D4;" runat="server" Width="55px"
                                    CssClass="input" onKeyPress="return false" onKeydown="return false"></asp:TextBox>
                                <AjaxControl:TextBoxWatermarkExtender ID="prefixWater" runat="server" TargetControlID="txtPrefix"
                                    WatermarkText="Prefix" WatermarkCssClass="watermark_textbox">
                                </AjaxControl:TextBoxWatermarkExtender>
                                <asp:TextBox ID="txtVoucher" runat="server" Width="31px" CssClass="inputnumber" ValidationGroup="V"
                                    MaxLength="10" Style="background-color: #C8D0D4;"></asp:TextBox>
                                <AjaxControl:TextBoxWatermarkExtender ID="voucherWater" runat="server" TargetControlID="txtVoucher"
                                    WatermarkText="Number" WatermarkCssClass="watermark_textbox">
                                </AjaxControl:TextBoxWatermarkExtender>
                                <asp:TextBox ID="txtSuffix" runat="server" Width="41px" CssClass="input" onKeyPress="return false"
                                    onKeydown="return false" Style="background-color: #C8D0D4;"></asp:TextBox>
                                <AjaxControl:TextBoxWatermarkExtender ID="suffixWater" runat="server" TargetControlID="txtSuffix"
                                    WatermarkText="Suffix" WatermarkCssClass="watermark_textbox">
                                </AjaxControl:TextBoxWatermarkExtender>
                            </td>
                            <td>
                                Invoice No of Supplier<span style="color: Red">*</span>
                            </td>
                            <td>
                                <asp:TextBox ID="txtInvoiceNo" runat="server" Width="278px" CssClass="input" ValidationGroup="V"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Invoice Date of Supplier <span style="color: Red">*</span>
                            </td>
                            <td>
                                <asp:UpdatePanel ID="UpdatePanel6" runat="server">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtDate" ForeColor="Black" runat="server" Width="122px" CssClass="input"
                                            ValidationGroup="V" onKeyPress="return false;"></asp:TextBox>
                                        <asp:ImageButton ID="btnDate" runat="server" ImageUrl="~/Images/calendar.gif" />
                                        <AjaxControl:CalendarExtender ID="CalFrom" runat="server" PopupButtonID="btnDate"
                                            Format="dd/MM/yyyy" TargetControlID="txtDate">
                                        </AjaxControl:CalendarExtender>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td>
                                Tax Group<span style="color: Red">*</span>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlTaxGroup" runat="server" Width="282px" onchange="TaxGroup();"
                                    CssClass="input" OnSelectedIndexChanged="ddlTaxGroup_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:HiddenField ID="hidpurchaseCounter" runat="server" />
                                <table id="tblLocalPurchase" runat="server" width="20%" style="display: none;">
                                    <tr>
                                        <td>
                                            SUBCLASSID
                                        </td>
                                        <td>
                                            SUBCLASSNAME
                                        </td>
                                        <td>
                                            TAXRATE
                                        </td>
                                    </tr>
                                </table>
                                <asp:HiddenField ID="hidURDpurchaseCounter" runat="server" />
                                <table id="tblURDPurchase" runat="server" width="20%" style="display: none;">
                                    <tr>
                                        <td>
                                            SUBCLASSID
                                        </td>
                                        <td>
                                            SUBCLASSNAME
                                        </td>
                                        <td>
                                            TAXRATE
                                        </td>
                                    </tr>
                                </table>
                                <asp:HiddenField ID="hidInterStatepurchaseCounter" runat="server" />
                                <table id="tblInterStatePurchase" runat="server" width="20%" style="display: none;">
                                    <tr>
                                        <td>
                                            SUBCLASSID
                                        </td>
                                        <td>
                                            SUBCLASSNAME
                                        </td>
                                        <td>
                                            TAXRATE
                                        </td>
                                    </tr>
                                </table>
                                <script type="text/javascript">
                                    function setdefaultvalue(val, row, index) {
                                        var SelectTaxId = document.getElementById("ddlTaxGroup").value;
                                        document.getElementById("hidsalestax" + row).value = val;
                                        var TaxRate = 0;
                                        if (Number(val) != 0) {
                                            //For Local Purchase TaxRate
                                            if (SelectTaxId == 1) {
                                                TaxRate = document.getElementById("txtSubTAX" + index).value;
                                            }
                                            //For URD Purchase TaxRate
                                            if (SelectTaxId == 2) {
                                                TaxRate = document.getElementById("txtURDSubTAX" + index).value;
                                            }
                                            //for InterState Purchase TaxRate
                                            if (SelectTaxId == 5) {
                                                TaxRate = document.getElementById("txtInterstateSubTAX" + index).value;
                                            }
                                            document.getElementById("hidsalestaxID" + row).value = val;
                                            document.getElementById("hidsalestax" + row).value = TaxRate;
                                            document.getElementById("txtvatcstamt" + row).value = parseFloat(parseFloat(document.getElementById("txtsubamount" + row).value) * parseFloat(TaxRate / 100)).toFixed(2);
                                            document.getElementById("txttotallanded" + row).value = parseFloat(parseFloat(document.getElementById("txtsubamount" + row).value) + parseFloat(document.getElementById("txtvatcstamt" + row).value) + parseFloat(document.getElementById("txtfreight").value) + parseFloat(document.getElementById("txtinsurance").value) + parseFloat(document.getElementById("txtpackaging").value)).toFixed(2);
                                            //if VAT Apply
                                            if (SelectTaxId == 1) {
                                                document.getElementById("txttotalinventcost" + row).value = parseFloat(parseFloat(document.getElementById("txttotallanded" + row).value) - parseFloat(document.getElementById("txtvatcstamt" + row).value) - parseFloat(document.getElementById("txtServiceTaxAmount" + row).value)).toFixed(2);
                                            }
                                            //if CST Apply
                                            if (SelectTaxId == 5) {
                                                document.getElementById("txttotalinventcost" + row).value = parseFloat(parseFloat(document.getElementById("txttotallanded" + row).value) - parseFloat(document.getElementById("txtvatcstamt" + row).value)).toFixed(2);
                                            }
                                            VATCST(); //for Total OF VAT/CST
                                        }
                                        if (Number(val) == 0) {
                                            document.getElementById("hidsalestaxID" + row).value = val;
                                            document.getElementById("hidsalestax" + row).value = TaxRate;
                                            document.getElementById("txtvatcstamt" + row).value = "0.00";
                                            document.getElementById("txttotallanded" + row).value = "0.00";
                                            document.getElementById("txttotalinventcost" + row).value = "0.00";
                                        }
                                        //}
                                        //Calculate();
                                        CalculatePackaging();
                                        calculatefreight();
                                        CalculateInsurance();
                                        GrandTotal();
                                    }
                                    function TaxGroup() {
                                        var SelectTaxId = document.getElementById("ddlTaxGroup").value;
                                        var TableCounter = document.getElementById("hidControlTblItems").value;
                                        var option;
                                        var SelectSalesTax;
                                        //SelectSalesTax.options.length = 0;  
                                        //for Local Purchase
                                        if (SelectTaxId == 1) {
                                            var TinNo = document.getElementById("hidCheckTinNo").value;
                                            if (TinNo == 0) {
                                                alert("Before Purchase Receive, Please Enter the Supplier [" + document.getElementById("lblSupplier").innerHTML + "] Tin No. In the Vendor Master.");
                                            }
                                            var PurLocalCounter = document.getElementById("hidpurchaseCounter").value;
                                            for (var j = 1; j <= TableCounter; j++) {
                                                SelectSalesTax = document.getElementById("ddlsalestax" + j);
                                                SelectSalesTax.options.length = 0;
                                                for (var i = 0; i <= PurLocalCounter; i++) {
                                                    if (i == 0) {
                                                        option = new Option("Select VAT/CST", "0");
                                                    }
                                                    else {
                                                        option = new Option(document.getElementById("txtSubClassName" + i).value, document.getElementById("txtSubClassID" + i).value);
                                                    }
                                                    SelectSalesTax.options[i] = option;
                                                }
                                            }
                                        }
                                        //For URD Purchase                                        
                                        //URDSelectSalesTax.options.length = 0;
                                        if (SelectTaxId == 2) {
                                            var PurURDCounter = document.getElementById("hidURDpurchaseCounter").value;
                                            for (var j = 1; j <= TableCounter; j++) {
                                                SelectSalesTax = document.getElementById("ddlsalestax" + j);
                                                SelectSalesTax.options.length = 0;
                                                for (var i = 0; i <= PurURDCounter; i++) {
                                                    if (i == 0) {
                                                        option = new Option("Select VAT/CST", "0");
                                                    }
                                                    else {
                                                        option = new Option(document.getElementById("txtURDSubClassName" + i).value, document.getElementById("txtURDSubClassID" + i).value);
                                                    }
                                                    SelectSalesTax.options[i] = option;
                                                }
                                            }
                                        }
                                        //For Inter State Purchase                                        
                                        //InterStateSelectSalesTax.options.length = 0;
                                        if (SelectTaxId == 5) {
                                            var TinNo = document.getElementById("hidCheckTinNo").value;
                                            if (TinNo == 0) {
                                                alert("Before Purchase Receive, Please Enter the Supplier [" + document.getElementById("lblSupplier").innerHTML + "] Tin No. In the Vendor Master.");
                                            }
                                            var PurInterCounter = document.getElementById("hidInterStatepurchaseCounter").value;
                                            for (var j = 1; j <= TableCounter; j++) {
                                                SelectSalesTax = document.getElementById("ddlsalestax" + j);
                                                SelectSalesTax.options.length = 0;
                                                for (var i = 0; i <= PurInterCounter; i++) {
                                                    if (i == 0) {
                                                        option = new Option("Select VAT/CST", "0");
                                                    }
                                                    else {
                                                        option = new Option(document.getElementById("txtInterstateSubClassName" + i).value, document.getElementById("txtInterstateSubClassID" + i).value);
                                                    }
                                                    SelectSalesTax.options[i] = option;
                                                }
                                            }
                                        }
                                    }
                                </script>
                                <asp:HiddenField ID="hidCheckTinNo" runat="server" Value="1" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Leased Type
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlleasedtype" Style="color: #000000; background-color: #C8D0D4;"
                                    CssClass="input" runat="server" Width="148px" Enabled="false" AutoPostBack="True">
                                    <asp:ListItem Value="0" Text="-Select Leased Type-"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="Owned"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="Consigned"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                Payment Mode
                            </td>
                            <td>
                                <div style="float: left;">
                                    <asp:RadioButtonList ID="rbtCashCredit" runat="server" RepeatDirection="Horizontal"
                                        Font-Size="Small">
                                        <asp:ListItem Selected="True" Text="COD" Value="2"></asp:ListItem>
                                        <asp:ListItem Value="0">Advance</asp:ListItem>
                                        <asp:ListItem Text="FOC" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Credit" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </div>
                                <div style="float: left; margin-left: 2px">
                                    <asp:TextBox ID="txtCreditDay" runat="server" CssClass="inputnumber" MaxLength="3"
                                        onblur="CreditDays()" onKeyPress="return isNumberKey(this.id,event)" Width="33px"></asp:TextBox>
                                    &nbsp;Days
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Select Currency
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlcurrency" CssClass="input" Style="color: #000000; background-color: #C8D0D4;"
                                    runat="server" AutoPostBack="True" Width="148px">
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:Label ID="lblTotalInvoiceVal" runat="server" Text="Label">Total Invoice Value<span style="color: Red">*</span></asp:Label>
                            </td>
                            <td>
                                <table cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="txtTotalInvoiceValue" CssClass="inputnumber" Width="100px" runat="server"
                                                Text="0.00" onfocus="if(this.value=='0.00') this.value='';" onblur="return Totolinvoicevalue();" onKeyPress="return isNumberKey(this.id,event);"
                                                Style="text-align: right;"></asp:TextBox>
                                            <script type="text/javascript">
                                                function Totolinvoicevalue() {
                                                    if (document.getElementById("txtTotalInvoiceValue").value == "") {
                                                        document.getElementById("txtTotalInvoiceValue").value = '0.00';
                                                        return false;
                                                    }
                                                }
                                            </script>
                                        </td>
                                        <td>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="lblFolioNo" runat="server" Text="Folio No"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtfolioNo" runat="server" Width="97px" CssClass="inputnumber" Style="text-align: left;"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Purchase Received Date <span style="color: Red">*</span>
                            </td>                            
                            <td>
                                <asp:UpdatePanel ID="UpdatePanel12" runat="server">
                                    <ContentTemplate>
                                        <asp:TextBox ID="TxtPurchaseReceiveDate" ForeColor="Black" runat="server" Width="143px"
                                            CssClass="input" ValidationGroup="V" onkeypress="return false;"></asp:TextBox>
                                        <AjaxControl:CalendarExtender ID="Cal" runat="server" Format="dd/MM/yyyy" TargetControlID="TxtPurchaseReceiveDate">
                                        </AjaxControl:CalendarExtender>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td>
                                <asp:Label ID="lblexchangerate" Visible="false" runat="server" Text="Label">Exchange Rate<span style="color: Red">*</span></asp:Label>
                            </td>
                            <td>
                                 <asp:TextBox ID="txtexcrate" CssClass="inputnumber" runat="server" Text="0.00" Visible="false"
                                    Width="100px" onblur="UnitPrice();" onfocus="if(this.value=='0.00') this.value='';"
                                    onKeyPress="return isNumberKey(this.id,event);" Style="text-align: right;"></asp:TextBox><%----%>
                            </td>
                        </tr>                        
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <div style="margin-left: 1%; margin-right: 1%;">
            <div id="wrapper">
                <ul class="tabs">
                    <li><a href="javascript:void(0)" class="defaulttab" rel="tabGeneral">General</a></li>
                    <li><a href="javascript:void(0)" rel="tabOther">Other</a></li>
                </ul>
                <div class="tab-content" id="tabGeneral" runat="server">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                        <ContentTemplate>
                            <asp:HiddenField ID="hidControlTblItems" Value="0" runat="server" />
                            <div id="generaltab" runat="server" style="border: 1px solid #818181; width: 100%;">
                                <table id="tblTaxItemLevel" runat="server" width="100%" cellspacing="0">
                                    <tr style="color: Black; font-size: 10px; font-family: Arial; font-weight: bold;
                                        border-bottom: 1px solid #818181;">
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 8%;">
                                            <%--Item(s)--%>
                                            Part No
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 8%;">
                                            Description
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            <%--Received Qty--%>
                                            Unit Price
                                        </td>
                                        <%--<td style="border-bottom: 1px solid #818181; text-align: center; font-weight: bold; ">

                                        </td>--%>
                                        <td style="border-bottom: 1px solid #818181; border-right: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Qty
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Sub Amount
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Sales Tax (VAT/CST)
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Sales Tax Amount
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Service Tax (%)
                                            <script type="text/javascript">
                                                function TotalServiceTax() {
                                                    var Count = document.getElementById("hidControlTblItems").value;
                                                    var TotalServiceTax = 0;
                                                    for (var i = 1; i <= Count; i++) {
                                                        TotalServiceTax = parseFloat(TotalServiceTax) + parseFloat(document.getElementById("txtServiceTaxAmount" + i).value);
                                                    }
                                                    document.getElementById("txtPostTaxTotal").value = parseFloat(TotalServiceTax).toFixed(2);
                                                }
                                                function ServiceTaxAmount(row) {
                                                    var SelectTaxId = document.getElementById("ddlTaxGroup").value
                                                    if (document.getElementById("txtServiceTax" + row).value == '') {
                                                        document.getElementById("txtServiceTax" + row).value = '0.00';
                                                    }
                                                    if (document.getElementById("txtvatcstamt" + row).value == '' || document.getElementById("txtvatcstamt" + row).value == '0.00') {
                                                        alert("Please Apply the Sales Tax.");
                                                        document.getElementById("txtServiceTax" + row).value = '0.00';
                                                        return false;
                                                    }
                                                    document.getElementById("txtServiceTaxAmount" + row).value = parseFloat(parseFloat(document.getElementById("txtsubamount" + row).value) * parseFloat(document.getElementById("txtServiceTax" + row).value / 100)).toFixed(2);
                                                    //if VAT Apply
                                                    if (SelectTaxId == 1) {
                                                        document.getElementById("txttotalinventcost" + row).value = parseFloat(parseFloat(document.getElementById("txttotallanded" + row).value) - parseFloat(document.getElementById("txtvatcstamt" + row).value) - parseFloat(document.getElementById("txtServiceTaxAmount" + row).value)).toFixed(2);
                                                    }
                                                    //if CST Apply
                                                    if (SelectTaxId == 5) {
                                                        document.getElementById("txttotalinventcost" + row).value = parseFloat(parseFloat(document.getElementById("txttotallanded" + row).value) - parseFloat(document.getElementById("txtvatcstamt" + row).value)).toFixed(2);
                                                    }
                                                    //LandedCost();
                                                    TotalLandedCost();
                                                    TotalServiceTax();
                                                    GrandTotal();
                                                    //Calculate();
                                                }
                                            </script>
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Service Tax Amount
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Freight
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Packaging
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Insurance
                                        </td>
                                        <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                            font-weight: bold; width: 7%;">
                                            Total Landed Cost
                                        </td>
                                        <td style="border-bottom: 1px solid #818181; text-align: center; font-weight: bold;
                                            width: 7%; display: none;">
                                            Total Inventory Cost
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div runat="server" id="calgeneral" style="width: 100%">
                                <%--<div style="width: 30%; float: right;">--%>
                                <table style="width: 27%; float: right; border: 1px solid #818181;" class="tablecontent"
                                    cellspacing="0">
                                    <tr>
                                        <td>
                                            <b>Total Item Quantity</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtTotalQuantity" Width="70px" runat="server" onkeydown="return CatchTab(this.id,event)"
                                                Text="0.00" CssClass="input" AutoCompleteType="Disabled" Style="background-color: #C8D0D4;
                                                text-align: right;"></asp:TextBox>
                                            <script type="text/javascript">
                                                function CheckValue(id) {
                                                    if (document.getElementById(id).value == '') {
                                                        document.getElementById(id).value = "0.00";
                                                    }
                                                }
                                            </script>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b>Total Landed Cost</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtGrossAmount" Width="70px" CssClass="labelText" runat="server"
                                                onkeydown="return CatchTab(this.id,event)" Text="0.00" AutoCompleteType="Disabled"
                                                Style="background-color: #C8D0D4; text-align: right;"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr style="display: none;">
                                        <td>
                                            <b>Total Inventory Cost</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtTaxableAmt" runat="server" Width="70px" CssClass="labelText"
                                                onkeydown="return CatchTab(this.id,event)" Text="0.00" AutoCompleteType="Disabled"
                                                Style="background-color: #C8D0D4; text-align: right;"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b>Total Sales Tax Amount</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtVat" runat="server" CssClass="labelText" Width="70px" onkeydown="return CatchTab(this.id,event)"
                                                Text="0.00" AutoCompleteType="Disabled" Style="background-color: #C8D0D4; text-align: right;"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b>Total Service Tax Amount</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtPostTaxTotal" runat="server" CssClass="labelText" Width="70px"
                                                onkeydown="return CatchTab(this.id,event)" Text="0.00" AutoCompleteType="Disabled"
                                                Style="background-color: #C8D0D4; text-align: right;"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b>Freight Amount</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtfreight" runat="server" Width="70px" onblur="CheckValue(this.id); return calculatefreight();"
                                                onfocus="if(this.value=='0.00') this.value='';" Style="text-align: right;" onchange="SetZero(this.id);"
                                                CssClass="labelText" Text="0.00" onKeyPress="return isNumberKey(this.id,event)"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b>Packaging Amount</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtpackaging" runat="server" Width="70px" onblur="CheckValue(this.id); return CalculatePackaging();"
                                                onfocus="if(this.value=='0.00') this.value='';" Style="text-align: right;" CssClass="labelText"
                                                onchange="SetZero(this.id);" Text="0.00" onKeyPress="return isNumberKey(this.id,event)"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b>Insurance Amount</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtinsurance" runat="server" Width="70px" onblur="CheckValue(this.id); return CalculateInsurance();"
                                                onfocus="if(this.value=='0.00') this.value='';" Style="text-align: right;" CssClass="labelText"
                                                onchange="SetZero(this.id);" Text="0.00" onKeyPress="return isNumberKey(this.id,event)"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b>Round off Amount</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtRoundoff" Width="70px" Style="text-align: right;" runat="server"
                                                CssClass="labelText" onblur="CheckValue(this.id); return GrandTotal();" Text="0.00"
                                                onfocus="if(this.value=='0.00') this.value='';" onchange="SetZero(this.id);"
                                                onKeyPress="return isNumberKey(this.id,event)"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b>Grand Total</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtGrandTotal" Width="70px" Style="background-color: #C8D0D4; text-align: right;"
                                                runat="server" onkeydown="return CatchTab(this.id,event)" Text="0.00" CssClass="labelText"
                                                AutoCompleteType="Disabled"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                                <%--</div>--%>
                            </div>
                            <%--For Imported Data--%>
                            <%----%>
                            <div id="tabImport" runat="server" style="width: 100%;">
                                <asp:UpdatePanel ID="UpdatePanel5" runat="server">
                                    <ContentTemplate>
                                        <asp:HiddenField ID="hidimportTblItems" Value="0" runat="server" />
                                        <div style="border: 1px solid #818181; width: 100%; overflow-x: scroll;">
                                            <table id="tblImportItemLevel" runat="server" width="135%">
                                                <tr style="color: Black; font-size: 10px; font-family: Arial; font-weight: bold;">
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 5%;">
                                                        Part No
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 5%;">
                                                        Desc
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 3%;">
                                                        COO
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 5%;">
                                                        Unit Price
                                                        <asp:Label ID="lblunitprice" runat="server"></asp:Label>
                                                        <script type="text/javascript">
                                                            function UnitPrice() {
                                                                //var exchangerate = document.getElementById("txtexcrate").value;
                                                                if (document.getElementById("txtexcrate").value == '') {
                                                                    document.getElementById("txtexcrate").value = '0.00';
                                                                }
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                for (var i = 1; i <= count; i++) {
                                                                    if (document.getElementById("txtexcrate").value == "" || document.getElementById("txtexcrate").value == "0.00") {
                                                                        //alert("Please Enter Exchange Rate.");
                                                                        document.getElementById("txtIExtendVal" + i).value = '0.00';
                                                                        document.getElementById("txtIUnitPriceINR" + i).value = '0.00';
                                                                        document.getElementById("txtIInvoiceVal" + i).value = '0.00';
                                                                        //return false;
                                                                    }
                                                                    if (parseFloat(document.getElementById("txtIUnitPrice" + i).value) > parseFloat(document.getElementById("hidIUnitPrice" + i).value)) {
                                                                        alert("Your Unit Price for this item is:-" + parseFloat(document.getElementById("hidIUnitPrice" + i).value).toFixed(5));
                                                                        document.getElementById("txtIUnitPrice" + i).value = '';
                                                                        return false;
                                                                    }
                                                                    else {
                                                                        if (document.getElementById("txtIUnitPrice" + i).value != '') {
                                                                            document.getElementById("txtIUnitPriceINR" + i).value = parseFloat(parseFloat(document.getElementById("txtIUnitPrice" + i).value) * parseFloat(document.getElementById("txtexcrate").value)).toFixed(5);
                                                                        }
                                                                        else {
                                                                            document.getElementById("txtIUnitPriceINR" + i).value = '';
                                                                        }
                                                                        InvoiceValue();
                                                                    }
                                                                }
                                                            }                                                        
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 3%;">
                                                        Qty
                                                        <script type="text/javascript">
                                                            function isNumber(evt) {
                                                                var charCode = (evt.which)
                                                                //alert(charCode); 
                                                                if (charCode == 46 || charCode == 47 || charCode == 44 || charCode == 59) {//&& charCode > 31 && (charCode < 48 || charCode > 57)) {
                                                                    return false;
                                                                }
                                                                if (charCode > 65 && charCode < 91) {
                                                                    return false;
                                                                }
                                                                if (charCode > 95 && charCode < 121) {
                                                                    return false;
                                                                }
                                                                //InvoiceValue();                                                          
                                                            }

                                                            function InvoiceValue() {                                                                                                                           
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var exchangerate = document.getElementById("txtexcrate").value;
                                                                for (var i = 1; i <= count; i++) {
                                                                    // alert("Hello");
                                                                    if (exchangerate == "" || exchangerate == "0.00") {
                                                                        //alert("Please Enter Exchange Rate.");
                                                                        //document.getElementById("txtIUnitPriceINR" + i).value = '';                                                                    
                                                                        return false;
                                                                    }
                                                                    var qty = document.getElementById("txtIQty" + i).value;
                                                                    var hidqty = document.getElementById("hidIQty" + i).value;

                                                                    if (parseInt(qty) > parseInt(hidqty)) {
                                                                        alert("Your Balance Quantity for this item is:- " + parseFloat(hidqty).toFixed(0));
                                                                        document.getElementById("txtIQty" + i).value = parseInt(hidqty);
                                                                        document.getElementById("txtIQty" + i).focus();
                                                                        return false;
                                                                    }
                                                                }                                                                
                                                                var tempadd = 0; var add = 0;
                                                                for (var j = 1; j <= count; j++) 
                                                                {
                                                                    if (document.getElementById("txtIQty" + j).value != '') 
                                                                    {
                                                                        add = parseFloat(document.getElementById("txtIQty" + j).value);
                                                                        tempadd = parseFloat(parseFloat(tempadd) + parseFloat(add));
                                                                    }
                                                                }
                                                                document.getElementById("txttotalitemquantity").value = tempadd                                                                
                                                                for (var i = 1; i <= count; i++) 
                                                                {
                                                                    if (document.getElementById("txtIQty" + i).value != '') 
                                                                    {
                                                                        document.getElementById("txtIInvoiceVal" + i).value = parseFloat(parseFloat(document.getElementById("txtIQty" + i).value) * parseFloat(document.getElementById("txtIUnitPriceINR" + i).value)).toFixed(5);
                                                                        document.getElementById("txtIExtendVal" + i).value = parseFloat(parseFloat(document.getElementById("txtIQty" + i).value) * parseFloat(parseFloat(document.getElementById("txtIUnitPrice" + i).value))).toFixed(5);
                                                                        document.getElementById("txtILandedCost" + i).value = parseFloat(parseFloat(document.getElementById("txtIInvoiceVal" + i).value) + parseFloat(document.getElementById("txtIGrandTotal" + i).value) + parseFloat(document.getElementById("txtIClearFreight" + i).value)).toFixed(5);
                                                                    }
                                                                    else 
                                                                    {
                                                                        document.getElementById("txtIInvoiceVal" + i).value = '';
                                                                        document.getElementById("txtIExtendVal" + i).value = '';
                                                                        document.getElementById("txtILandedCost" + i).value = '';
                                                                    }
                                                                }
                                                                totalGrossAmount();
                                                            }
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 5%;">
                                                        Extended Value
                                                        <asp:Label ID="lblunitprice1" runat="server"></asp:Label>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 5%;">
                                                        Unit Price (INR)
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 5%;">
                                                        Invoice Value (INR)
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 5%;">
                                                        Asse Value (INR)
                                                        <script type="text/javascript">
                                                            function CustomeDuty(row) {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var totalAssesVal = 0;
                                                                if (document.getElementById("txtIAsseval" + row).value == '') {
                                                                    document.getElementById("txtIAsseval" + row).value = '0.00';
                                                                }
                                                                for (var i = 1; i <= count; i++) {
                                                                    var AssesValue = document.getElementById("txtIAsseval" + i).value;
                                                                    if (AssesValue > 0) {
                                                                        //First Check the Exchange rate.
                                                                        if (document.getElementById("txtexcrate").value == "" || document.getElementById("txtexcrate").value == "0.00") {
                                                                            alert("Please Enter the Exchange Rate.");
                                                                            document.getElementById("txtexcrate").focus();
                                                                            return false;
                                                                        }
                                                                        totalAssesVal = parseFloat(totalAssesVal) + parseFloat(AssesValue);
                                                                        document.getElementById("txtAssesValue").value = parseFloat(totalAssesVal).toFixed(5);
                                                                    }
                                                                }
                                                                document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                document.getElementById("txtICVD" + row).value = '0.00';
                                                                document.getElementById("txtIEducess" + row).value = '0.00';
                                                                document.getElementById("txtIHEducess" + row).value = '0.00';
                                                                document.getElementById("txtITotalduty" + row).value = '0.00';
                                                                document.getElementById("txtICustomedu" + row).value = '0.00';
                                                                document.getElementById("txtICustomHSedu" + row).value = '0.00';
                                                                document.getElementById("txtIAddDuty" + row).value = '0.00';
                                                                //For find the TaxVal

                                                                SetDefaultforBasicCD(Taxval, row);
                                                            }
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 7%;">
                                                        Basic Custom Duty (INR)
                                                        <script type="text/javascript">
                                                            function TotalBasiCCustomDuty() {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var totalBasicCustomDuty = 0;
                                                                for (var i = 1; i <= count; i++) {
                                                                    var CustomValue = document.getElementById("txtIBasicCust" + i).value;
                                                                    if (CustomValue == '') {
                                                                        CustomValue = '0.00';
                                                                    }
                                                                    if (CustomValue != '') {
                                                                        totalBasicCustomDuty = parseFloat(totalBasicCustomDuty) + parseFloat(CustomValue);
                                                                        document.getElementById("txtBasicCustomDuty").value = parseFloat(totalBasicCustomDuty).toFixed(5);
                                                                    }
                                                                }
                                                            }
                                                            function SetDefaultforBasicCD(Taxval, row) {
                                                                var txtAssesvalue = document.getElementById("txtIAsseval" + row).value;

                                                                if (Taxval == 0) {
                                                                    document.getElementById("hidIBasicCust" + row).value = '0.00';
                                                                    document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                    document.getElementById("txtIBasicCust" + row).value = parseFloat(parseFloat(document.getElementById("txtIAsseval" + row).value) * (parseFloat(Taxval) / 100)).toFixed(2);
                                                                    if (document.getElementById("txtIBasicCust" + row).value == '') {
                                                                        document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtICVD" + row).value == '') {
                                                                        document.getElementById("txtICVD" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIEducess" + row).value == '') {
                                                                        document.getElementById("txtIEducess" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIHEducess" + row).value == '') {
                                                                        document.getElementById("txtIHEducess" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtITotalduty" + row).value = parseFloat(parseFloat(document.getElementById("txtIBasicCust" + row).value) + parseFloat(document.getElementById("txtICVD" + row).value) + parseFloat(document.getElementById("txtIEducess" + row).value) + parseFloat(document.getElementById("txtIHEducess" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIGrandTotal" + row).value = document.getElementById("txtITotalduty" + row).value;
                                                                    if (document.getElementById("txtIClearFreight" + row).value == '') {
                                                                        document.getElementById("txtIClearFreight" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtILandedCost" + row).value = parseFloat(document.getElementById("txtIInvoiceVal" + row).value) + parseFloat(document.getElementById("txtIGrandTotal" + row).value) + parseFloat(document.getElementById("txtIClearFreight" + row).value).toFixed(5);
                                                                    document.getElementById("txtIInventCost" + row).value = parseFloat(document.getElementById("txtILandedCost" + row).value) - parseFloat(document.getElementById("txtICVD" + row).value) - parseFloat(document.getElementById("txtIEducess" + row).value) - parseFloat(document.getElementById("txtIHEducess" + row).value).toFixed(5);
                                                                    if (document.getElementById("txtfreight").value == '') {
                                                                        document.getElementById("txtfreight").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtPackage").value == '') {
                                                                        document.getElementById("txtPackage").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtInsur").value == '') {
                                                                        document.getElementById("txtInsur").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtotherCharges").value == '') {
                                                                        document.getElementById("txtotherCharges").value = '0.00';
                                                                    }
                                                                    document.getElementById("txtBasicCustomDuty").value = '0.00';
                                                                }
                                                                if (Taxval != 0) {
                                                                    if (txtAssesvalue == '' || txtAssesvalue == "0.00") {
                                                                        alert("Please Enter the Asses Value.");
                                                                        document.getElementById("txtIAsseval" + row).focus();
                                                                        return false;
                                                                    }
                                                                    if (txtAssesvalue != '') {
                                                                        document.getElementById("txtIBasicCust" + row).value = parseFloat(parseFloat(document.getElementById("txtIAsseval" + row).value) * (parseFloat(Taxval) / 100)).toFixed(5);

                                                                        if (document.getElementById("txtIBasicCust" + row).value == '') {
                                                                            document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                        }
                                                                        if (document.getElementById("txtICVD" + row).value == '') {
                                                                            document.getElementById("txtICVD" + row).value = '0.00';
                                                                        }
                                                                        if (document.getElementById("txtIEducess" + row).value == '') {
                                                                            document.getElementById("txtIEducess" + row).value = '0.00';
                                                                        }
                                                                        if (document.getElementById("txtIHEducess" + row).value == '') {
                                                                            document.getElementById("txtIHEducess" + row).value = '0.00';
                                                                        }
                                                                        document.getElementById("txtITotalduty" + row).value = parseFloat(parseFloat(document.getElementById("txtIBasicCust" + row).value) + parseFloat(document.getElementById("txtICVD" + row).value) + parseFloat(document.getElementById("txtIEducess" + row).value) + parseFloat(document.getElementById("txtIHEducess" + row).value)).toFixed(5);
                                                                        if (document.getElementById("txtIClearFreight" + row).value == '') {
                                                                            document.getElementById("txtIClearFreight" + row).value = '0.00';
                                                                        }
                                                                        if (document.getElementById("txtIInvoiceVal" + row).value == '') {
                                                                            document.getElementById("txtIInvoiceVal" + row).value = '0.00';
                                                                        }
                                                                        if (document.getElementById("txtIGrandTotal" + row).value == '') {
                                                                            document.getElementById("txtIGrandTotal" + row).value = '0.00';
                                                                        }
                                                                        document.getElementById("txtILandedCost" + row).value = parseFloat(document.getElementById("txtIInvoiceVal" + row).value) + parseFloat(document.getElementById("txtIGrandTotal" + row).value) + parseFloat(document.getElementById("txtIClearFreight" + row).value).toFixed(5);
                                                                        document.getElementById("txtIInventCost" + row).value = parseFloat(document.getElementById("txtILandedCost" + row).value) - parseFloat(document.getElementById("txtICVD" + row).value) - parseFloat(document.getElementById("txtIEducess" + row).value) - parseFloat(document.getElementById("txtIHEducess" + row).value).toFixed(5);
                                                                        if (document.getElementById("txtfreight").value == '') {
                                                                            document.getElementById("txtfreight").value = '0.00';
                                                                        }
                                                                        if (document.getElementById("txtPackage").value == '') {
                                                                            document.getElementById("txtPackage").value = '0.00';
                                                                        }
                                                                        if (document.getElementById("txtInsur").value == '') {
                                                                            document.getElementById("txtInsur").value = '0.00';
                                                                        }
                                                                        if (document.getElementById("txtotherCharges").value == '') {
                                                                            document.getElementById("txtotherCharges").value = '0.00';
                                                                        }
                                                                    }
                                                                }
                                                                TotalBasiCCustomDuty(); totalGrossAmount();
                                                            }
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 7%;">
                                                        CVD (INR)
                                                        <script type="text/javascript">
                                                            function GrandTotalDuty() {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var totalGrandDuty = 0;
                                                                for (var i = 1; i <= count; i++) {
                                                                    var GrandDutyValue = document.getElementById("txtIGrandTotal" + i).value;
                                                                    if (GrandDutyValue == '') {
                                                                        GrandDutyValue = '0.00';
                                                                    }
                                                                    if (GrandDutyValue != '') {
                                                                        totalGrandDuty = parseFloat(totalGrandDuty) + parseFloat(GrandDutyValue);
                                                                        document.getElementById("txtDutyPayable").value = parseFloat(totalGrandDuty).toFixed(5);
                                                                    }
                                                                }
                                                            }
                                                            function TotalCVDDuty() {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var totalCVD = 0;
                                                                for (var i = 1; i <= count; i++) {
                                                                    var CVDValue = document.getElementById("txtICVD" + i).value;
                                                                    if (CVDValue == '') {
                                                                        CVDValue = '0.00';
                                                                    }
                                                                    if (CVDValue != '') {
                                                                        totalCVD = parseFloat(totalCVD) + parseFloat(CVDValue);
                                                                        document.getElementById("txtCvd").value = parseFloat(totalCVD).toFixed(5);
                                                                    }
                                                                }
                                                            }
                                                            function SetDefaultforCVD(TaxCVDval, row) {
                                                                if (TaxCVDval == 0) {
                                                                    //document.getElementById("hidICVD" + row).value = parseFloat((parseFloat(document.getElementById("txtIAsseval" + row).value) + parseFloat(document.getElementById("txtIBasicCust" + row).value)) * (parseFloat(TaxCVDval / 100))).toFixed(2);
                                                                    document.getElementById("txtICVD" + row).value = parseFloat((parseFloat(document.getElementById("txtIAsseval" + row).value) + parseFloat(document.getElementById("txtIBasicCust" + row).value)) * (parseFloat(TaxCVDval / 100))).toFixed(5);
                                                                    if (document.getElementById("txtIBasicCust" + row).value == '') {
                                                                        document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtICVD" + row).value == '') {
                                                                        document.getElementById("txtICVD" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIEducess" + row).value == '') {
                                                                        document.getElementById("txtIEducess" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIHEducess" + row).value == '') {
                                                                        document.getElementById("txtIHEducess" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtITotalduty" + row).value == '') {
                                                                        document.getElementById("txtITotalduty" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtICustomedu" + row).value == '') {
                                                                        document.getElementById("txtICustomedu" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtICustomHSedu" + row).value == '') {
                                                                        document.getElementById("txtICustomHSedu" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("hidIAddDuty" + row).value == '') {
                                                                        document.getElementById("hidIAddDuty" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtITotalduty" + row).value = parseFloat(parseFloat(document.getElementById("txtIBasicCust" + row).value) + parseFloat(document.getElementById("txtICVD" + row).value) + parseFloat(document.getElementById("txtIEducess" + row).value) + parseFloat(document.getElementById("txtIHEducess" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                    if (document.getElementById("txtIClearFreight" + row).value != '') {
                                                                        document.getElementById("txtIClearFreight" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtILandedCost" + row).value = parseFloat(parseFloat(document.getElementById("txtIGrandTotal" + row).value) + parseFloat(document.getElementById("txtIInvoiceVal" + row).value) + parseFloat(document.getElementById("txtIClearFreight" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIInventCost" + row).value = parseFloat(document.getElementById("txtILandedCost" + row).value) - parseFloat(document.getElementById("txtICVD" + row).value) - parseFloat(document.getElementById("txtIEducess" + row).value) - parseFloat(document.getElementById("txtIHEducess" + row).value).toFixed(5);
                                                                    //if (document.getElementById("txtposttax").value == '') {
                                                                    //document.getElementById("txtposttax").value = '0.00';
                                                                    //}
                                                                    if (document.getElementById("txtfreight").value == '') {
                                                                        document.getElementById("txtfreight").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtPackage").value == '') {
                                                                        document.getElementById("txtPackage").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtInsur").value == '') {
                                                                        document.getElementById("txtInsur").value = '0.00';
                                                                    }
                                                                    //if (document.getElementById("txtDomRoundOffAmt").value == '') {
                                                                    //document.getElementById("txtDomRoundOffAmt").value = '0.00';
                                                                    //}
                                                                    if (document.getElementById("txtotherCharges").value == '') {
                                                                        document.getElementById("txtotherCharges").value = '0.00';
                                                                    }
                                                                    //document.getElementById("txtGranTotal").value = parseFloat(parseFloat(document.getElementById("txtposttax").value) + parseFloat(document.getElementById("txtfreight").value) + parseFloat(document.getElementById("txtPackage").value) + parseFloat(document.getElementById("txtInsur").value) + parseFloat(document.getElementById("txtDomRoundOffAmt").value) + parseFloat(document.getElementById("txtotherCharges").value)).toFixed(2);

                                                                    //                                                                if (document.getElementById("hidICVD" + row).value != '') {
                                                                    //                                                                    a = parseFloat(a) + parseFloat(document.getElementById("hidICVD" + row).value).toFixed(2);
                                                                    //                                                                    document.getElementById("txtCvd").value = parseFloat(a).toFixed(2);
                                                                    //                                                                }
                                                                    ////CustomeDuty();
                                                                }
                                                                if (TaxCVDval != 0) {
                                                                    //document.getElementById("hidICVD" + row).value = parseFloat((parseFloat(document.getElementById("txtIAsseval" + row).value) + parseFloat(document.getElementById("txtIBasicCust" + row).value)) * (parseFloat(TaxCVDval / 100))).toFixed(5);
                                                                    document.getElementById("txtICVD" + row).value = parseFloat((parseFloat(document.getElementById("txtIAsseval" + row).value) + parseFloat(document.getElementById("txtIBasicCust" + row).value)) * (parseFloat(TaxCVDval / 100))).toFixed(5);
                                                                    if (document.getElementById("txtIBasicCust" + row).value == '') {
                                                                        document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtICVD" + row).value == '') {
                                                                        document.getElementById("txtICVD" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIEducess" + row).value == '') {
                                                                        document.getElementById("txtIEducess" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIHEducess" + row).value == '') {
                                                                        document.getElementById("txtIHEducess" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtITotalduty" + row).value == '') {
                                                                        document.getElementById("txtITotalduty" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtICustomedu" + row).value == '') {
                                                                        document.getElementById("txtICustomedu" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtICustomHSedu" + row).value == '') {
                                                                        document.getElementById("txtICustomHSedu" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("hidIAddDuty" + row).value == '') {
                                                                        document.getElementById("hidIAddDuty" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtITotalduty" + row).value = parseFloat(parseFloat(document.getElementById("txtIBasicCust" + row).value) + parseFloat(document.getElementById("txtICVD" + row).value) + parseFloat(document.getElementById("txtIEducess" + row).value) + parseFloat(document.getElementById("txtIHEducess" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                    if (document.getElementById("txtIClearFreight" + row).value != '') {
                                                                        document.getElementById("txtIClearFreight" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtILandedCost" + row).value = parseFloat(parseFloat(document.getElementById("txtIGrandTotal" + row).value) + parseFloat(document.getElementById("txtIInvoiceVal" + row).value) + parseFloat(document.getElementById("txtIClearFreight" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIInventCost" + row).value = parseFloat(document.getElementById("txtILandedCost" + row).value) - parseFloat(document.getElementById("txtICVD" + row).value) - parseFloat(document.getElementById("txtIEducess" + row).value) - parseFloat(document.getElementById("txtIHEducess" + row).value).toFixed(5);
                                                                    //if (document.getElementById("txtposttax").value == '') {
                                                                    //document.getElementById("txtposttax").value = '0.00';
                                                                    //}
                                                                    if (document.getElementById("txtfreight").value == '') {
                                                                        document.getElementById("txtfreight").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtPackage").value == '') {
                                                                        document.getElementById("txtPackage").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtInsur").value == '') {
                                                                        document.getElementById("txtInsur").value = '0.00';
                                                                    }
                                                                    //if (document.getElementById("txtDomRoundOffAmt").value == '') {
                                                                    //document.getElementById("txtDomRoundOffAmt").value = '0.00';
                                                                    //}
                                                                    if (document.getElementById("txtotherCharges").value == '') {
                                                                        document.getElementById("txtotherCharges").value = '0.00';
                                                                    }
                                                                    //document.getElementById("txtGranTotal").value = parseFloat(parseFloat(document.getElementById("txtposttax").value) + parseFloat(document.getElementById("txtfreight").value) + parseFloat(document.getElementById("txtPackage").value) + parseFloat(document.getElementById("txtInsur").value) + parseFloat(document.getElementById("txtDomRoundOffAmt").value) + parseFloat(document.getElementById("txtotherCharges").value)).toFixed(2);
                                                                }
                                                                TotalCVDDuty(); GrandTotalDuty();
                                                                totalGrossAmount();
                                                            }
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 7%;">
                                                        EDU Cess on CVD 2% (INR)
                                                        <script type="text/javascript">
                                                            function TotolEduCess2() {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var totalCVD2 = 0;
                                                                for (var i = 1; i <= count; i++) {
                                                                    var CVDValue2 = document.getElementById("txtIEducess" + i).value;

                                                                    if (CVDValue2 == '') {
                                                                        CVDValue2 = '0.00';
                                                                    }
                                                                    if (CVDValue2 != '') {
                                                                        totalCVD2 = parseFloat(totalCVD2) + parseFloat(CVDValue2);
                                                                        document.getElementById("txtEcessonCVD").value = parseFloat(totalCVD2).toFixed(5);
                                                                    }
                                                                }
                                                            }
                                                            function ForEduCessOnCVD2(TaxEduHCVD2, row) {
                                                                if (TaxEduHCVD2 != 0) {
                                                                    if (document.getElementById("txtICVD" + row).value == '') {
                                                                        document.getElementById("txtICVD" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtIEducess" + row).value = parseFloat(parseFloat(document.getElementById("txtICVD" + row).value) * (parseFloat(TaxEduHCVD2) / 100)).toFixed(5);
                                                                    if (document.getElementById("txtIBasicCust" + row).value == '') {
                                                                        document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                    }

                                                                    if (document.getElementById("txtIEducess" + row).value == '') {
                                                                        document.getElementById("txtIEducess" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIHEducess" + row).value == '') {
                                                                        document.getElementById("txtIHEducess" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtITotalduty" + row).value = parseFloat(parseFloat(document.getElementById("txtIBasicCust" + row).value) + parseFloat(document.getElementById("txtICVD" + row).value) + parseFloat(document.getElementById("txtIEducess" + row).value) + parseFloat(document.getElementById("txtIHEducess" + row).value)).toFixed(5);
                                                                    //document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                }
                                                                else {
                                                                    if (document.getElementById("txtICVD" + row).value == '') {
                                                                        document.getElementById("txtICVD" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtIEducess" + row).value = parseFloat(parseFloat(document.getElementById("txtICVD" + row).value) * (parseFloat(TaxEduHCVD2) / 100)).toFixed(5);
                                                                    if (document.getElementById("txtIBasicCust" + row).value == '') {
                                                                        document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                    }

                                                                    if (document.getElementById("txtIEducess" + row).value == '') {
                                                                        document.getElementById("txtIEducess" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIHEducess" + row).value == '') {
                                                                        document.getElementById("txtIHEducess" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtITotalduty" + row).value = parseFloat(parseFloat(document.getElementById("txtIBasicCust" + row).value) + parseFloat(document.getElementById("txtICVD" + row).value) + parseFloat(document.getElementById("txtIEducess" + row).value) + parseFloat(document.getElementById("txtIHEducess" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                }
                                                                TotolEduCess2();
                                                            }                                                        
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 7%;">
                                                        H Edu Cess on CVD 1% (INR)
                                                        <script type="text/javascript">
                                                            function TotolEduCess1() {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var totalCVD1 = 0;
                                                                for (var i = 1; i <= count; i++) {
                                                                    var CVDValue1 = document.getElementById("txtIHEducess" + i).value;
                                                                    if (CVDValue1 == '') {
                                                                        CVDValue1 = '0.00';
                                                                    }
                                                                    if (CVDValue1 != '') {
                                                                        totalCVD1 = parseFloat(totalCVD1) + parseFloat(CVDValue1);
                                                                        document.getElementById("txtSHECessOnCVD").value = parseFloat(totalCVD1).toFixed(5);
                                                                    }
                                                                }
                                                            }
                                                            function ForEduCessOnCVD1(TaxEduCVD1, row) {
                                                                if (TaxEduCVD1 != 0) {
                                                                    document.getElementById("txtIHEducess" + row).value = parseFloat(parseFloat(document.getElementById("txtICVD" + row).value) * (parseFloat(TaxEduCVD1) / 100)).toFixed(5);
                                                                    if (document.getElementById("txtIBasicCust" + row).value == '') {
                                                                        document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtICVD" + row).value == '') {
                                                                        document.getElementById("txtICVD" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIEducess" + row).value == '') {
                                                                        document.getElementById("txtIEducess" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIHEducess" + row).value == '') {
                                                                        document.getElementById("txtIHEducess" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtITotalduty" + row).value = parseFloat(parseFloat(document.getElementById("txtIBasicCust" + row).value) + parseFloat(document.getElementById("txtICVD" + row).value) + parseFloat(document.getElementById("txtIEducess" + row).value) + parseFloat(document.getElementById("txtIHEducess" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                }
                                                                else {
                                                                    document.getElementById("txtIHEducess" + row).value = parseFloat(parseFloat(document.getElementById("txtICVD" + row).value) * (parseFloat(TaxEduCVD1) / 100)).toFixed(5);
                                                                    if (document.getElementById("txtIBasicCust" + row).value == '') {
                                                                        document.getElementById("txtIBasicCust" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtICVD" + row).value == '') {
                                                                        document.getElementById("txtICVD" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIEducess" + row).value == '') {
                                                                        document.getElementById("txtIEducess" + row).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtIHEducess" + row).value == '') {
                                                                        document.getElementById("txtIHEducess" + row).value = '0.00';
                                                                    }
                                                                    document.getElementById("txtITotalduty" + row).value = parseFloat(parseFloat(document.getElementById("txtIBasicCust" + row).value) + parseFloat(document.getElementById("txtICVD" + row).value) + parseFloat(document.getElementById("txtIEducess" + row).value) + parseFloat(document.getElementById("txtIHEducess" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                }
                                                                TotolEduCess1();
                                                            }
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 5%;">
                                                        Total Duty (INR)
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 7%;">
                                                        Custom Educational Cess 2% (INR)
                                                        <script type="text/javascript">
                                                            function TotolEduCustomCess2() {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var totalCustomCVD2 = 0;
                                                                for (var i = 1; i <= count; i++) {
                                                                    var CVDCustomValue2 = document.getElementById("txtICustomedu" + i).value;
                                                                    if (CVDCustomValue2 == '') {
                                                                        CVDCustomValue2 = '0.00';
                                                                    }
                                                                    if (CVDCustomValue2 != '') {
                                                                        totalCustomCVD2 = parseFloat(totalCustomCVD2) + parseFloat(CVDCustomValue2);
                                                                        document.getElementById("txtCustomeduCess").value = parseFloat(totalCustomCVD2).toFixed(5);
                                                                    }
                                                                }
                                                            }
                                                            function SetDefaultforeducessoncustom(TaxCustomEdu, row) {
                                                                var txtTotalDuty = document.getElementById("txtITotalduty" + row).value;
                                                                var txtCustomEdu = document.getElementById("txtICustomedu" + row).value;
                                                                if (TaxCustomEdu != 0) {
                                                                    document.getElementById("txtICustomedu" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) * parseFloat(TaxCustomEdu) / 100).toFixed(5);
                                                                    //SetDefaultforADDduty(TaxCustomEdu, row)
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                    document.getElementById("txtILandedCost" + row).value = parseFloat(parseFloat(document.getElementById("txtIInvoiceVal" + row).value) + parseFloat(document.getElementById("txtIGrandTotal" + row).value) + parseFloat(document.getElementById("txtIClearFreight" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIInventCost" + row).value = parseFloat(parseFloat(document.getElementById("txtILandedCost" + row).value) - parseFloat(document.getElementById("hidICVD" + row).value) - parseFloat(document.getElementById("txtICustomedu" + row).value) - parseFloat(document.getElementById("txtICustomHSedu" + row).value)).toFixed(5);
                                                                }
                                                                else {
                                                                    document.getElementById("txtICustomedu" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) * parseFloat(TaxCustomEdu) / 100).toFixed(5);
                                                                }
                                                                TotolEduCustomCess2(); totalGrossAmount();
                                                            }
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 7%;">
                                                        Custom H & S Educational Cess 1% (INR)
                                                        <script type="text/javascript">
                                                            function TotolEduCustomCess1() {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var totalCustomCVD1 = 0;
                                                                for (var i = 1; i <= count; i++) {
                                                                    var CVDCustomValue1 = document.getElementById("txtICustomHSedu" + i).value;
                                                                    if (CVDCustomValue1 == '') {
                                                                        CVDCustomValue1 = '0.00';
                                                                    }
                                                                    if (CVDCustomValue1 != '') {
                                                                        totalCustomCVD1 = parseFloat(totalCustomCVD1) + parseFloat(CVDCustomValue1);
                                                                        document.getElementById("txtSHCustomEduCess").value = parseFloat(totalCustomCVD1).toFixed(5);
                                                                    }
                                                                }
                                                            }
                                                            function SetDefaultforHSeducessoncustom(TaxtHCustom, row) {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var a = "0.00";
                                                                //for (var i = 1; i <= count; i++) {
                                                                var txtTotalDuty = document.getElementById("txtITotalduty" + row).value;
                                                                var txtCustomHEdu = document.getElementById("txtICustomHSedu" + row).value;
                                                                if (TaxtHCustom != 0) {
                                                                    document.getElementById("txtICustomHSedu" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) * parseFloat(TaxtHCustom / 100)).toFixed(5);
                                                                    //SetDefaultforADDduty(TaxtHCustom, row)
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                    document.getElementById("txtILandedCost" + row).value = parseFloat(parseFloat(document.getElementById("txtIInvoiceVal" + row).value) + parseFloat(document.getElementById("txtIGrandTotal" + row).value) + parseFloat(document.getElementById("txtIClearFreight" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIInventCost" + row).value = parseFloat(parseFloat(document.getElementById("txtILandedCost" + row).value) - parseFloat(document.getElementById("hidICVD" + row).value) - parseFloat(document.getElementById("txtICustomedu" + row).value) - parseFloat(document.getElementById("txtICustomHSedu" + row).value)).toFixed(5);
                                                                }
                                                                else {
                                                                    document.getElementById("txtICustomHSedu" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) * parseFloat(TaxtHCustom / 100)).toFixed(5);
                                                                }
                                                                TotolEduCustomCess1(); totalGrossAmount();
                                                            }
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 7%;">
                                                        Add.Duty 4% (INR)
                                                        <script type="text/javascript">
                                                            function TotolAddlDuty() {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var totalAddlDuty = 0;
                                                                for (var i = 1; i <= count; i++) {
                                                                    var TotalAddlD = document.getElementById("txtIAddDuty" + i).value;
                                                                    if (TotalAddlD == '') {
                                                                        TotalAddlD = '0.00';
                                                                    }
                                                                    if (TotalAddlD != '') {
                                                                        totalAddlDuty = parseFloat(totalAddlDuty) + parseFloat(TotalAddlD);
                                                                        document.getElementById("txtAddlDuty").value = parseFloat(totalAddlDuty).toFixed(5);
                                                                    }
                                                                }
                                                            }
                                                            function SetDefaultforADDduty(TaxAddDutyVal, row) {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var a = 0.0; var b = 0.0;
                                                                var Index = document.getElementById("ddlIAddDuty" + row).selectedIndex;
                                                                var txtIAddDuty = document.getElementById("txtIAddDuty" + row).value;
                                                                var txtAssesvalue = document.getElementById("txtIAsseval" + row).value;
                                                                var txtTotalDuty = document.getElementById("txtITotalduty" + row).value;
                                                                var hidIAddDuty = document.getElementById("hidIAddDuty" + row).value;
                                                                var txtCustomEdu = document.getElementById("txtICustomedu" + row).value;
                                                                var txtCustomHEdu = document.getElementById("txtICustomHSedu" + row).value;
                                                                var txtIGrandTotal = document.getElementById("txtIGrandTotal" + row).value;
                                                                var txtInvoiceVal = document.getElementById("txtIInvoiceVal" + row).value;
                                                                var txtfreight = document.getElementById("txtIClearFreight" + row).value;
                                                                var txttotallanded = document.getElementById("txtILandedCost" + row).value;
                                                                var txtinventorycost = document.getElementById("txtIInventCost" + row).value;
                                                                var hidCVD = document.getElementById("hidICVD" + row).value;
                                                                if (TaxAddDutyVal != 0) {
                                                                    document.getElementById("txtIAddDuty" + row).value = parseFloat((parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtIAsseval" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value)) * parseFloat(TaxAddDutyVal / 100)).toFixed(5);
                                                                    document.getElementById("hidIAddDuty" + row).value = parseFloat((parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtIAsseval" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value)) * parseFloat(TaxAddDutyVal / 100)).toFixed(5);
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                    document.getElementById("txtILandedCost" + row).value = parseFloat(parseFloat(document.getElementById("txtIInvoiceVal" + row).value) + parseFloat(document.getElementById("txtIGrandTotal" + row).value) + parseFloat(document.getElementById("txtIClearFreight" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIInventCost" + row).value = parseFloat(parseFloat(document.getElementById("txtILandedCost" + row).value) - parseFloat(document.getElementById("hidICVD" + row).value) - parseFloat(document.getElementById("txtICustomedu" + row).value) - parseFloat(document.getElementById("txtICustomHSedu" + row).value)).toFixed(5);
                                                                    //document.getElementById("txtGross").value = parseFloat(document.getElementById("").value) + parseFloat(document.getElementById("txtILandedCost" + row).value);
                                                                    //document.getElementById("txtTaxable").value = parseFloat(document.getElementById("txtIInventCost" + row).value).toFixed(2);
                                                                    //document.getElementById("txtposttax").value = parseFloat(document.getElementById("txtGross").value).toFixed(2);
                                                                    //if (document.getElementById("txtposttax").value == '') {
                                                                    //document.getElementById("txtposttax").value = '0.00';
                                                                    //}

                                                                    if (document.getElementById("txtfreight").value == '') {
                                                                        document.getElementById("txtfreight").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtPackage").value == '') {
                                                                        document.getElementById("txtPackage").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtInsur").value == '') {
                                                                        document.getElementById("txtInsur").value = '0.00';
                                                                    }
                                                                    //if (document.getElementById("txtDomRoundOffAmt").value == '') {
                                                                    //document.getElementById("txtDomRoundOffAmt").value = '0.00';
                                                                    //}
                                                                    if (document.getElementById("txtotherCharges").value == '') {
                                                                        document.getElementById("txtotherCharges").value = '0.00';
                                                                    }

                                                                    //document.getElementById("txtGranTotal").value = parseFloat(parseFloat(document.getElementById("txtposttax").value) + parseFloat(document.getElementById("txtfreight").value) + parseFloat(document.getElementById("txtPackage").value) + parseFloat(document.getElementById("txtInsur").value) + parseFloat(document.getElementById("txtDomRoundOffAmt").value) + parseFloat(document.getElementById("txtotherCharges").value)).toFixed(2);

                                                                }
                                                                if (Index == 0) {
                                                                    document.getElementById("hidIAddDuty" + row).value = '0.00';
                                                                    document.getElementById("txtIAddDuty" + row).value = '0.00';
                                                                    document.getElementById("txtIGrandTotal" + row).value = parseFloat(parseFloat(document.getElementById("txtITotalduty" + row).value) + parseFloat(document.getElementById("txtICustomedu" + row).value) + parseFloat(document.getElementById("txtICustomHSedu" + row).value) + parseFloat(document.getElementById("hidIAddDuty" + row).value)).toFixed(5);
                                                                    document.getElementById("txtILandedCost" + row).value = parseFloat(parseFloat(document.getElementById("txtIInvoiceVal" + row).value) + parseFloat(document.getElementById("txtIGrandTotal" + row).value) + parseFloat(document.getElementById("txtIClearFreight" + row).value)).toFixed(5);
                                                                    document.getElementById("txtIInventCost" + row).value = parseFloat(parseFloat(document.getElementById("txtILandedCost" + row).value) - parseFloat(document.getElementById("hidICVD" + row).value) - parseFloat(document.getElementById("txtICustomedu" + row).value) - parseFloat(document.getElementById("txtICustomHSedu" + row).value)).toFixed(5);
                                                                    //document.getElementById("txtGross").value = document.getElementById("txtILandedCost" + i).value;
                                                                    //document.getElementById("txtTaxable").value = parseFloat(document.getElementById("txtIInventCost" + i).value).toFixed(2);
                                                                    //document.getElementById("txtposttax").value = parseFloat(document.getElementById("txtGross").value).toFixed(2);
                                                                    //if (document.getElementById("txtposttax").value == '') {
                                                                    //document.getElementById("txtposttax").value = '0.00';
                                                                    //}
                                                                    if (document.getElementById("txtfreight").value == '') {
                                                                        document.getElementById("txtfreight").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtPackage").value == '') {
                                                                        document.getElementById("txtPackage").value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtInsur").value == '') {
                                                                        document.getElementById("txtInsur").value = '0.00';
                                                                    }
                                                                    //if (document.getElementById("txtDomRoundOffAmt").value == '') {
                                                                    //document.getElementById("txtDomRoundOffAmt").value = '0.00';
                                                                    //}
                                                                    if (document.getElementById("txtotherCharges").value == '') {
                                                                        document.getElementById("txtotherCharges").value = '0.00';
                                                                    }
                                                                    //document.getElementById("txtGranTotal").value = parseFloat(parseFloat(document.getElementById("txtposttax").value) + parseFloat(document.getElementById("txtfreight").value) + parseFloat(document.getElementById("txtPackage").value) + parseFloat(document.getElementById("txtInsur").value) + parseFloat(document.getElementById("txtDomRoundOffAmt").value) + parseFloat(document.getElementById("txtotherCharges").value)).toFixed(2);
                                                                    //document.getElementById("txtImportGrandTotal").value
                                                                }
                                                                TotolAddlDuty();
                                                                //Total Inventory Cost
                                                                var temp = "0.00";
                                                                for (var i = 1; i <= count; i++) {
                                                                    if (document.getElementById("txtIInventCost" + i).value != '') {
                                                                        temp = parseFloat(parseFloat(temp) + parseFloat(document.getElementById("txtIInventCost" + i).value)).toFixed(5);
                                                                        document.getElementById("txtTaxable").value = parseFloat(temp).toFixed(5);
                                                                    }
                                                                }
                                                                //document.getElementById("txtImportGrandTotal").value = parseFloat(temp).toFixed(2);
                                                                GrandTotalDuty();
                                                                totalGrossAmount();
                                                                //GrandTotal();
                                                            }
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 10%;">
                                                        Grand Total Duty (INR)
                                                        <script type="text/javascript">
                                                            function totalGrossAmount() {
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                var temp = "0.00";
                                                                for (var i = 1; i <= count; i++) {
                                                                    if (document.getElementById("txtILandedCost" + i).value == '') {
                                                                        document.getElementById("txtILandedCost" + i).value = '0.00';
                                                                    }
                                                                    if (document.getElementById("txtILandedCost" + i).value != '') {
                                                                        temp = parseFloat(temp) + parseFloat(document.getElementById("txtILandedCost" + i).value);
                                                                        document.getElementById("txtGross").value = parseFloat(temp).toFixed(5);
                                                                    }
                                                                }
                                                                document.getElementById("txtImportGrandTotal").value = parseFloat(temp).toFixed(5);
                                                            }
                                                        </script>
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 14%;">
                                                        Clearing/ Freight/ Packaging/ Insurance/ Others Charges (INR)
                                                    </td>
                                                    <td style="border-right: 1px solid #818181; border-bottom: 1px solid #818181; text-align: center;
                                                        font-weight: bold; width: 20%;">
                                                        Total Landed Cost (INR)
                                                    </td>
                                                    <td style="border-bottom: 1px solid #818181; text-align: center; font-weight: bold;
                                                        width: 14%; display: none;">
                                                        Total Inventory Cost (INR)
                                                        <script type="text/javascript">
                                                        function GrandTotal() {
                                                            var totalLandedCost = document.getElementById("txtGross").value;
                                                            var freight = document.getElementById("txtClearingfreight").value;
                                                            var packaing = document.getElementById("txtPackage").value;
                                                            var Insurance = document.getElementById("txtInsur").value;
                                                            //var roundoff = document.getElementById("txtDomRoundOffAmt").value;
                                                            var OtherCharge = document.getElementById("txtotherCharges").value;
                                                            if (totalLandedCost == '') {
                                                                totalLandedCost = "0.00";
                                                            }
                                                            if (freight == '') {
                                                                freight = "0.00";
                                                            }
                                                            if (packaing == '') {
                                                                packaing = "0.00";
                                                            }
                                                            if (Insurance == '') {
                                                                Insurance = "0.00";
                                                            }
                                                            //if (roundoff == '') {
                                                                //roundoff = "0.00";
                                                            //}
                                                            if (OtherCharge == '') {
                                                                OtherCharge = "0.00";
                                                            }
                                                            //document.getElementById("txtImportGrandTotal").value = parseFloat(parseFloat(totalLandedCost) + parseFloat(freight) + parseFloat(packaing) + parseFloat(Insurance) + parseFloat(roundoff) + parseFloat(OtherCharge)).toFixed(2);
                                                        </script>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </div>
                            <div id="calImport" runat="server">
                                <asp:UpdatePanel ID="Updatepanel4" runat="server">
                                    <ContentTemplate>
                                        <div style="border: 1px solid #818181; float: right;" align="right">
                                            <table cellpadding="2" cellspacing="0">
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lbl1" Text="Asses Value" Font-Size="12px" Font-Names="Verdana" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtAssesValue" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                    <td rowspan="9" style="border-right: 1px solid #818181;">
                                                        &nbsp;
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label1" Text="Total Item Quantity" Font-Size="12px" Font-Names="Verdana"
                                                            runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txttotalitemquantity" Width="60px" runat="server" onkeydown="return CatchTab(this.id,event)"
                                                            Text="0.00" CssClass="labelText" AutoCompleteType="Disabled" Style="background-color: #C8D0D4;
                                                            text-align: right;"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label2" Text="BCD" Font-Size="12px" Font-Names="Verdana" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtBasicCustomDuty" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label3" Text="Total Landed Cost" Font-Size="12px" Font-Names="Verdana"
                                                            runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtGross" Width="60px" runat="server" onkeydown="return CatchTab(this.id,event)"
                                                            Text="0.00" CssClass="labelText" AutoCompleteType="Disabled" Style="background-color: #C8D0D4;
                                                            text-align: right;"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label4" Text="CVD" Font-Size="12px" Font-Names="Verdana" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtCvd" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label14" Text="Addl.Duty (Imports)" Font-Size="12px" Font-Names="Verdana"
                                                            runat="server"></asp:Label>
                                                        <asp:Label ID="Label5" Text="Total Inventory Cost" Style="display: none;" Font-Size="12px"
                                                            Font-Names="Verdana" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtTaxable" Width="60px" runat="server" onkeydown="return CatchTab(this.id,event)"
                                                            Text="0.00" CssClass="labelText" AutoCompleteType="Disabled" Style="display: none;
                                                            background-color: #C8D0D4; text-align: right;"></asp:TextBox>
                                                        <asp:TextBox ID="txtAddlDuty" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label6" Text="E.Cess on CVD" Font-Size="12px" Font-Names="Verdana"
                                                            runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtEcessonCVD" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <%--<asp:Label ID="Label9" runat="server" Font-Names="Verdana" Font-Size="12px" Text="Total Landed Cost"></asp:Label>--%>
                                                        <asp:Label ID="Label11" runat="server" Font-Names="Verdana" Font-Size="12px" Text="Clearing/Freight Charges"></asp:Label>
                                                        <script type="text/javascript">
                                                            function FreightCal() {
                                                                var InvoiceVal = 0; var tempamount = 0;
                                                                var count = document.getElementById("hidimportTblItems").value;
                                                                if (document.getElementById("txtotherCharges").value == '') {
                                                                    document.getElementById("txtotherCharges").value = "0.00";
                                                                }
                                                                if (document.getElementById("txtClearingfreight").value == '') {
                                                                    document.getElementById("txtClearingfreight").value = '0.00';
                                                                }
                                                                if (document.getElementById("txtPackage").value == '') {
                                                                    document.getElementById("txtPackage").value = '0.00';
                                                                }
                                                                if (document.getElementById("txtInsur").value == '') {
                                                                    document.getElementById("txtInsur").value = '0.00';
                                                                }
                                                                //if (document.getElementById("txtDomRoundOffAmt").value == '') {
                                                                //document.getElementById("txtDomRoundOffAmt").value = '0.00';
                                                                //}
                                                                var clearingfreight = parseFloat(document.getElementById("txtClearingfreight").value) + parseFloat(document.getElementById("txtotherCharges").value) + parseFloat(document.getElementById("txtPackage").value) + parseFloat(document.getElementById("txtInsur").value);
                                                                if (clearingfreight != 0) {
                                                                    for (var i = 1; i <= count; i++) {
                                                                        if (document.getElementById("txtIInvoiceVal" + i).value != '') {
                                                                            InvoiceVal = parseFloat(parseFloat(InvoiceVal) + parseFloat(document.getElementById("txtIInvoiceVal" + i).value)).toFixed(5);
                                                                        }
                                                                    }
                                                                    for (var j = 1; j <= count; j++) {
                                                                        if (document.getElementById("txtIInvoiceVal" + j).value != '') {
                                                                            tempamount = parseFloat(clearingfreight) / parseFloat(InvoiceVal);
                                                                            document.getElementById("txtIClearFreight" + j).value = parseFloat(parseFloat(tempamount) * parseFloat(document.getElementById("txtIInvoiceVal" + j).value)).toFixed(5);
                                                                            document.getElementById("txtILandedCost" + j).value = parseFloat(parseFloat(document.getElementById("txtIInvoiceVal" + j).value) + parseFloat(document.getElementById("txtIGrandTotal" + j).value) + parseFloat(document.getElementById("txtIClearFreight" + j).value)).toFixed(5)
                                                                            document.getElementById("txtIInventCost" + j).value = parseFloat(parseFloat(document.getElementById("txtILandedCost" + j).value) - parseFloat(document.getElementById("txtICVD" + j).value) - parseFloat(document.getElementById("txtICustomedu" + j).value) - parseFloat(document.getElementById("txtICustomHSedu" + j).value)).toFixed(5);
                                                                        }
                                                                    }
                                                                }
                                                                //document.getElementById("txtGranTotal").value = parseFloat(parseFloat(document.getElementById("txtposttax").value) + parseFloat(document.getElementById("txtClearingfreight").value) + parseFloat(document.getElementById("txtPackage").value) + parseFloat(document.getElementById("txtInsur").value) + parseFloat(document.getElementById("txtDomRoundOffAmt").value) + parseFloat(document.getElementById("txtotherCharges").value)).toFixed(2);
                                                                //alert(parseFloat(parseFloat(document.getElementById("txtposttax").value) + parseFloat(document.getElementById("txtfreight").value) + parseFloat(document.getElementById("txtPackage").value) + parseFloat(document.getElementById("txtInsur").value) + parseFloat(document.getElementById("txtDomRoundOffAmt").value) + parseFloat(document.getElementById("txtotherCharges").value)).toFixed(2));
                                                                //Total Inventory Cost
                                                                var temp = "0.00";
                                                                for (var i = 1; i <= count; i++) {
                                                                    if (document.getElementById("txtIInventCost" + i).value != '') {
                                                                        temp = parseFloat(parseFloat(temp) + parseFloat(document.getElementById("txtIInventCost" + i).value)).toFixed(5);
                                                                        document.getElementById("txtTaxable").value = parseFloat(temp).toFixed(5);
                                                                    }
                                                                }
                                                                //Total Landed Cost
                                                                totalGrossAmount();
                                                            }
                                                        </script>
                                                    </td>
                                                    <td>
                                                        <%--<asp:TextBox ID="txtposttax" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                        onkeydown="return CatchTab(this.id,event)" Style="background-color: lightGray;
                                                        text-align: right;" Text="0.00" Width="60px"></asp:TextBox>--%>
                                                        <asp:TextBox ID="txtClearingfreight" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onblur="return FreightCal();" onchange="SetZero(this.id);" onfocus="RemoveZero(this.id);"
                                                            onKeyPress="return isNumberKey(this.id,event)" Style="text-align: right;" Text="0.00"
                                                            Width="60px"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label8" Text="SHE. Cess On CVD" Font-Size="12px" Font-Names="Verdana"
                                                            runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtSHECessOnCVD" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label13" runat="server" Font-Names="Verdana" Font-Size="12px" Text="Packaging Charge"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtPackage" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onchange="SetZero(this.id);" onblur="FreightCal();" onfocus="RemoveZero(this.id);"
                                                            onKeyPress="return isNumberKey(this.id,event)" Style="text-align: right;" Text="0.00"
                                                            Width="60px"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label10" Text="Custom Edu. Cess" Font-Size="12px" Font-Names="Verdana"
                                                            runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtCustomeduCess" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label15" runat="server" Font-Names="Verdana" Font-Size="12px" Text="Insurance"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtInsur" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onchange="SetZero(this.id);" onfocus="RemoveZero(this.id);" onblur="FreightCal();"
                                                            onKeyPress="return isNumberKey(this.id,event)" Style="text-align: right;" Text="0.00"
                                                            Width="60px"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label12" Text="SH Customs Edu.Cess" Font-Size="12px" Font-Names="Verdana"
                                                            runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtSHCustomEduCess" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="Label18" runat="server" Font-Names="Verdana" Font-Size="12px" Text="Other Charges"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtotherCharges" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onchange="SetZero(this.id);" onfocus="RemoveZero(this.id);" onblur="FreightCal();"
                                                            onKeyPress="return isNumberKey(this.id,event)" Style="text-align: right;" Text="0.00"
                                                            Width="60px"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label16" Text="Duty Payable" Font-Size="12px" Font-Names="Verdana"
                                                            runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtDutyPayable" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                            onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <%--<asp:Label ID="Label17" runat="server" Font-Names="Verdana" Font-Size="12px" Text="Round Off Amount"></asp:Label>--%>
                                                        <asp:Label ID="Label19" Text="Grand Total" Font-Size="12px" Font-Bold="true" Font-Names="Verdana"
                                                            runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <%--<asp:TextBox ID="txtDomRoundOffAmt" runat="server" AutoCompleteType="Disabled" CssClass="labelText"
                                                        onchange="SetZero(this.id);" onblur="FreightCal();" onfocus="RemoveZero(this.id);"
                                                        onKeyPress="return isNumberKey(this.id,event)" Style="text-align: right;" Text="0.00"
                                                        Width="60px"></asp:TextBox>--%>
                                                        <asp:TextBox ID="txtImportGrandTotal" runat="server" AutoCompleteType="Disabled"
                                                            CssClass="labelText" onkeydown="return CatchTab(this.id,event)" Style="background-color: #C8D0D4;
                                                            text-align: right;" Text="0.00" Width="60px"></asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <div style="clear: both;">
                    </div>
                </div>
            </div>
            <div class="tab-content" id="tabOther" runat="server">
                <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                    <ContentTemplate>
                        <div style="width: 100%">
                            <div style="width: 48%; float: left; margin-right: 2%">
                                <table style="width: 100%">
                                    <tr>
                                        <td style="width: 30%">
                                            Billing Address
                                        </td>
                                        <td style="width: 70%">
                                            <asp:TextBox ID="txtBillAddress" runat="server" Style="background-color: #D4D0C8;"
                                                TextMode="MultiLine" onkeypress="return false;" CssClass="input" Width="97%"
                                                Height="60px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 30%">
                                            Delivery Address
                                        </td>
                                        <td style="width: 70%">
                                            <asp:TextBox ID="txtDeliveryAdd" runat="server" Style="background-color: #D4D0C8;"
                                                onkeypress="return false;" TextMode="MultiLine" CssClass="input" Width="97%"
                                                Height="60px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 30%">
                                            Narration
                                        </td>
                                        <td style="width: 70%">
                                            <asp:TextBox ID="txtNarration" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 30%">
                                            Remarks
                                        </td>
                                        <td style="width: 70%">
                                            <asp:TextBox ID="txtRemark" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div style="width: 48%; float: left;">
                                <table style="width: 100%">
                                    <tr>
                                        <td style="width: 40%">
                                            Mode of Delivery
                                        </td>
                                        <td style="width: 60%">
                                            <asp:TextBox ID="txtDeliveryMode" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 40%">
                                            Delivery Date
                                        </td>
                                        <td style="width: 60%">
                                            <asp:TextBox ID="txtDeliveryDate" runat="server" Width="97%" CssClass="input" ValidationGroup="V"></asp:TextBox>
                                            <AjaxControl:CalendarExtender ID="extCal2" runat="server" TargetControlID="txtDeliveryDate"
                                                Format="dd/MM/yyyy">
                                            </AjaxControl:CalendarExtender>
                                            <AjaxControl:MaskedEditExtender ID="maskDeliveryDate" runat="server" TargetControlID="txtDeliveryDate"
                                                MaskType="Date" Mask="99/99/9999" CultureName="en-GB">
                                            </AjaxControl:MaskedEditExtender>
                                            <AjaxControl:MaskedEditValidator ID="maskValidDelivery" InvalidValueMessage="Invalid Date"
                                                runat="server" ControlToValidate="txtDeliveryDate" ControlExtender="maskDeliveryDate"
                                                IsValidEmpty="true" ValidationGroup="V"></AjaxControl:MaskedEditValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 40%">
                                            Document NO.
                                        </td>
                                        <td style="width: 60%">
                                            <asp:TextBox ID="txtDocumentNo" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 40%">
                                            Transporter Name
                                        </td>
                                        <td style="width: 60%">
                                            <asp:TextBox ID="txtTransporter" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 40%">
                                            Vehicle Number
                                        </td>
                                        <td style="width: 60%">
                                            <asp:TextBox ID="txtVehicle" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 40%">
                                            <asp:Label ID="lblSalePerson" runat="server"></asp:Label>
                                        </td>
                                        <td style="width: 60%">
                                            <asp:TextBox ID="txtSalesPerson" runat="server" Width="97%" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 40%">
                                            Prepared By
                                        </td>
                                        <td style="width: 60%">
                                            <asp:TextBox ID="txtPreparedBy" runat="server" Style="background-color: #D4D0C8;"
                                                Width="97%" onkeypress="return false;" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 40%">
                                            Checked By
                                        </td>
                                        <td style="width: 60%">
                                            <asp:TextBox ID="txtCheckedBy" runat="server" Style="background-color: #D4D0C8;"
                                                onkeypress="return false;" Width="97%" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 40%">
                                            Authorized Signatory
                                        </td>
                                        <td style="width: 60%">
                                            <asp:TextBox ID="txtSignatory" runat="server" Style="background-color: #D4D0C8;"
                                                onkeypress="return false;" Width="97%" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <div style="clear: both">
                    &nbsp;</div>
            </div>
        </div>
        <div style="width: 98%">
            <table style="width: 98%; text-align: center">
                <tr>
                    <td class="style1">
                        <asp:Button ID="btnSubmit" Text="Submit" runat="server" CssClass="button" ValidationGroup="V"
                            OnClientClick="return  AllValidation();" OnClick="btnSubmit_Click" />
                        &nbsp;
                        <asp:Button ID="btnCancel" Text="Cancel" runat="server" CssClass="button" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>
